Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
module Paintable
def color
puts "Blue"
super
end
end
class Vehicle
def color
puts "Green"
end
end
class Car < Vehicle
prepend Paintable
def color
puts "Red"
end
end
car = Car.new
car.color
# Blue
# Red
# => nil
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment