Created
May 25, 2010 00:00
-
-
Save jnunemaker/412580 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
# I need class C to call the foo method for each module included | |
# that has the method foo. Order does not matter as much as each | |
# method getting called. alias method chain? | |
module A | |
def foo | |
super | |
puts 'a' | |
end | |
end | |
module B | |
def foo | |
super | |
puts 'b' | |
end | |
end | |
class C | |
include A | |
include B | |
def foo | |
super | |
puts 'c' | |
end | |
end | |
C.new.foo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment