Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Showing prepend in the middle.
module Plugin
def some_method
puts "Plugin"
super
end
end
class A
def some_method
puts "A"
end
end
class B < A
prepend Plugin
def some_method
puts "B"
super
end
end
class C < B
def some_method
puts "C"
super
end
end
C.new.some_method

aghyad commented Apr 11, 2013

C
Plugin
B
A

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment