Class: Proc
Instance Method Summary collapse
-
#bind(object) ⇒ Object
Part of the Rails Object#instance_exec implementation.
Instance Method Details
#bind(object) ⇒ Object
Part of the Rails Object#instance_exec implementation
2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 |
# File 'lib/qt/qtruby4.rb', line 2668 def bind(object) block, time = self, Time.now (class << object; self end).class_eval do method_name = "__bind_#{time.to_i}_#{time.usec}" define_method(method_name, &block) method = instance_method(method_name) remove_method(method_name) method end.bind(object) end |