Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
tag: v3.1.12
Fetching contributors…

Cannot retrieve contributors at this time

15 lines (13 sloc) 0.372 kB
require "active_support/core_ext/kernel/singleton_class"
class Proc #:nodoc:
def bind(object)
block, time = self, Time.now
object.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
end
Jump to Line
Something went wrong with that request. Please try again.