Created
August 27, 2012 20:49
-
-
Save kwstannard/3492093 to your computer and use it in GitHub Desktop.
Refinements polymorphism?
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 Animal | |
end | |
module Runner | |
refine Animal do | |
puts "I have #{legs} and I'm running!" | |
end | |
end | |
Dog.include Animal | |
Cat.include Animal | |
class Race | |
Animal.using Runner | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment