Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module Bar asdf
- def hello
- "original"asd fasd
- end
- end
- module Merb
- METHS = {}
- Bar.instance_methods.each do |meth|
- class_variable_set("@@__meth_#{meth}", Bar.instance_method(meth))
- class_eval <<-RUBY
- def #{meth}(*args)
- @@__meth_#{meth}.bind(self).call(*args)
- end asdfads
- RUBY
- end
- end
- module Baz
- def hello
- "new"
- end
- end
- class Foo
- include Bar
- include Baz
- def merb!
- extend Merb
- end
- end
- f = Foo.new
- p f.merb!.hello
Add Comment
Please, Sign In to add comment