Skip to content

Instantly share code, notes, and snippets.

@JEG2
Created March 27, 2013 16:18
Show Gist options
  • Save JEG2/5255567 to your computer and use it in GitHub Desktop.
Save JEG2/5255567 to your computer and use it in GitHub Desktop.
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
Copy link

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