Created
June 25, 2012 07:41
-
-
Save jballanc/2987184 to your computer and use it in GitHub Desktop.
If this isn't multiple inheritance, then what is?
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 A | |
def report | |
puts "reporting from A" | |
end | |
end | |
class B | |
def report | |
puts "reporting from B" | |
end | |
end | |
class C < B | |
def report | |
puts "calling super from C" | |
super | |
end | |
end | |
C.new.report | |
C.send(:include, A).new.report |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment