Skip to content

Instantly share code, notes, and snippets.

@oliverswitzer
Last active August 29, 2015 13:57
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 oliverswitzer/9846672 to your computer and use it in GitHub Desktop.
Save oliverswitzer/9846672 to your computer and use it in GitHub Desktop.
A simple gist demonstrating how Ruby looks up module methods when they've been included in a class
module Engine
def run
puts "GRRRRRRRRR"
end
end
class Vehicle
def run
puts "I'm a thing that moves!"
end
end
class Car < Vehicle
include Engine
def run
puts "I'm driving!"
end
end
myCar = Car.new
puts myCar.run
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment