public Method

Proc.bind(object)

Part of the Rails Object#instance_exec implementation

Source Code

# File 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
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.