Skip to content

Instantly share code, notes, and snippets.

@dyoder
Created September 9, 2012 20:18
Show Gist options
  • Save dyoder/3686998 to your computer and use it in GitHub Desktop.
Save dyoder/3686998 to your computer and use it in GitHub Desktop.
Class and instance methods in Ruby
module FooMethods
def bar
"bar"
end
end
class Foo
extend FooMethods
include FooMethods
end
puts Foo.bar
puts Foo.new.bar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment