Created
April 19, 2010 15:27
-
-
Save mlomnicki/371157 to your computer and use it in GitHub Desktop.
Modules order
This file contains 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 ModOne | |
def hello | |
"hello1" | |
end | |
end | |
module ModTwo | |
def hello | |
"hello2" | |
end | |
end | |
class Foo | |
include ModOne, ModTwo | |
end | |
class Bar | |
include ModOne | |
include ModTwo | |
end | |
puts Foo.new.hello # => hello1 | |
puts Bar.new.hello # => hello2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment