Created
March 23, 2012 09:07
-
-
Save benlangfeld/2168734 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
{9:07}[ruby-1.9.3]~/Desktop ben% ruby super_module.rb | |
C | |
B2 | |
B | |
A |
This file contains hidden or 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
class A | |
def foo | |
puts 'A' | |
end | |
end | |
module B | |
def foo | |
puts 'B' | |
super | |
end | |
end | |
module B2 | |
def foo | |
puts 'B2' | |
super | |
end | |
end | |
class C < A | |
include B | |
include B2 | |
def foo | |
puts 'C' | |
super | |
end | |
end | |
C.new.foo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment