Skip to content

Instantly share code, notes, and snippets.

@TikiTDO
Created June 14, 2013 00:52
Show Gist options
  • Save TikiTDO/5778657 to your computer and use it in GitHub Desktop.
Save TikiTDO/5778657 to your computer and use it in GitHub Desktop.
module ZZ
def self.prepended(target)
puts "included"
end
def hi
puts 123
super
end
end
module CC
def hi
puts 990
super
end
end
class A
ex = Module.new
ex_c = class << ex; self;end
ex.send(:define_method, :hi) do |*args, &block|
puts "nnn"
super(*args, &block)
end
prepend ZZ
prepend CC
prepend ex
def hi
puts "bye"
end
end
A.new.hi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment