Created
February 28, 2012 02:30
-
-
Save jonnyzheng/1928765 to your computer and use it in GitHub Desktop.
class include two module with same method name
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 Sport | |
def walk | |
puts 'i am walking by sprot' | |
end | |
end | |
module Life | |
def walk | |
puts 'i am walking by life' | |
end | |
end | |
class Pepole | |
include Sport | |
include Life | |
end | |
# will print "i am walking by life" | |
Pepole.new.walk |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment