Created
December 8, 2015 22:53
-
-
Save saterus/f88d1f67aa2c3c0c4df1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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