Created
February 22, 2011 07:13
-
-
Save uasi/838328 to your computer and use it in GitHub Desktop.
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 Mod1 | |
def hello | |
puts "Hello from Mod1" | |
end | |
end | |
module Mod2 | |
def hello | |
puts "Hello from Mod2" | |
end | |
end | |
class Cls1 | |
include Mod1 | |
alias hello_from_mod1 hello | |
include Mod2 | |
alias hello hello_from_mod1 | |
end | |
Cls1.new.hello # => Hello from Mod1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment