Skip to content

Instantly share code, notes, and snippets.

@saterus
Created December 8, 2015 22:53
Show Gist options
  • Save saterus/f88d1f67aa2c3c0c4df1 to your computer and use it in GitHub Desktop.
Save saterus/f88d1f67aa2c3c0c4df1 to your computer and use it in GitHub Desktop.
module Foo
def instance_foo
puts "called instance_foo"
end
def self.classy_foo
puts "called classy_foo"
end
end
Foo.classy_foo
# => called classy_foo
Foo.instance_foo
# => NoMethodError
class Bar
include Foo
end
Bar.classy_foo
# => NoMethodError
Bar.new.instance_foo
# => called instance_foo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment