Skip to content

Instantly share code, notes, and snippets.

@jnunemaker
Created May 25, 2010 00:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save jnunemaker/412580 to your computer and use it in GitHub Desktop.
Save jnunemaker/412580 to your computer and use it in GitHub Desktop.
# 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