Skip to content

Instantly share code, notes, and snippets.

@benlangfeld
Created March 23, 2012 09:07
Show Gist options
  • Save benlangfeld/2168734 to your computer and use it in GitHub Desktop.
Save benlangfeld/2168734 to your computer and use it in GitHub Desktop.
{9:07}[ruby-1.9.3]~/Desktop ben% ruby super_module.rb
C
B2
B
A
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