Created
June 14, 2013 00:52
-
-
Save TikiTDO/5778657 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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