Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Object
- def define_method(name, &block)
- singleton = class << self; self; end
- singleton.send(:define_method, name) { |*args| block.call(*args) }
- end
- end
- i = 1
- loop do
- # ...
- node.define_method(:index) { i }
- # ...
- i += 1
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement