Class: Proc

Inherits:
Object show all
Defined in:
lib/Qt/qtruby4.rb

Instance Method Summary collapse

Instance Method Details

#bind(object) ⇒ Object

Part of the Rails Object#instance_exec implementation



3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
# File 'lib/Qt/qtruby4.rb', line 3084

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