Skip to content

Instantly share code, notes, and snippets.

@ivaravko
Forked from JEG2/prepend.rb
Created April 4, 2013 18:28
Show Gist options
  • Save ivaravko/5312821 to your computer and use it in GitHub Desktop.
Save ivaravko/5312821 to your computer and use it in GitHub Desktop.
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment