Skip to content

Instantly share code, notes, and snippets.

@jonnyzheng
Created February 28, 2012 02:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jonnyzheng/1928765 to your computer and use it in GitHub Desktop.
Save jonnyzheng/1928765 to your computer and use it in GitHub Desktop.
class include two module with same method name
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