Sha256: b95d770256fd195daca0863a7541866c5f11b162fda64f58a3219dc2e07452bd

Contents?: true

Size: 373 Bytes

Versions: 307

Compression:

Stored size: 373 Bytes

Contents

# Stolen straight from ActiveSupport

class Proc #:nodoc:
  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
end

Version data entries

307 entries across 258 versions & 47 rubygems

Version Path
poolparty-1.3.7 vendor/gems/shoulda/lib/shoulda/proc_extensions.rb
poolparty-1.3.6 vendor/gems/shoulda/lib/shoulda/proc_extensions.rb
poolparty-1.3.4 vendor/gems/shoulda/lib/shoulda/proc_extensions.rb
poolparty-1.3.3 vendor/gems/shoulda/lib/shoulda/proc_extensions.rb
poolparty-1.3.1 vendor/gems/shoulda/lib/shoulda/proc_extensions.rb
spree-0.8.4 vendor/plugins/resource_controller/test/vendor/plugins/shoulda/lib/shoulda/gem/proc_extensions.rb
spree-0.8.5 vendor/plugins/resource_controller/test/vendor/plugins/shoulda/lib/shoulda/gem/proc_extensions.rb
gnip-1.0.0 test/lib/shoulda/proc_extensions.rb
gnip-1.1.1 test/lib/shoulda/proc_extensions.rb
gnip-1.1.2 test/lib/shoulda/proc_extensions.rb
gnip-0.4.2 test/lib/shoulda/proc_extensions.rb
resource_controller-0.4.9 test/vendor/plugins/shoulda/lib/shoulda/gem/proc_extensions.rb
resource_controller-0.5.2 test/vendor/plugins/shoulda/lib/shoulda/gem/proc_extensions.rb
resource_controller-0.5.1 test/vendor/plugins/shoulda/lib/shoulda/gem/proc_extensions.rb
resource_controller-0.5.3 test/vendor/plugins/shoulda/lib/shoulda/gem/proc_extensions.rb
resource_controller-0.5.0 test/vendor/plugins/shoulda/lib/shoulda/gem/proc_extensions.rb
spree-0.4.0 vendor/plugins/resource_controller/test/vendor/plugins/shoulda/lib/shoulda/gem/proc_extensions.rb
spree-0.4.1 vendor/plugins/resource_controller/test/vendor/plugins/shoulda/lib/shoulda/gem/proc_extensions.rb
spree-0.5.0 vendor/plugins/resource_controller/test/vendor/plugins/shoulda/lib/shoulda/gem/proc_extensions.rb
spree-0.5.1 vendor/plugins/resource_controller/test/vendor/plugins/shoulda/lib/shoulda/gem/proc_extensions.rb