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
spree-0.6.0 vendor/plugins/resource_controller/test/vendor/plugins/shoulda/lib/shoulda/gem/proc_extensions.rb
spree-0.7.1 vendor/plugins/resource_controller/test/vendor/plugins/shoulda/lib/shoulda/gem/proc_extensions.rb
spree-0.7.0 vendor/plugins/resource_controller/test/vendor/plugins/shoulda/lib/shoulda/gem/proc_extensions.rb
spree-0.8.0 vendor/plugins/resource_controller/test/vendor/plugins/shoulda/lib/shoulda/gem/proc_extensions.rb
spree-0.8.1 vendor/plugins/resource_controller/test/vendor/plugins/shoulda/lib/shoulda/gem/proc_extensions.rb
spree-0.8.2 vendor/plugins/resource_controller/test/vendor/plugins/shoulda/lib/shoulda/gem/proc_extensions.rb
spree-0.8.3 vendor/plugins/resource_controller/test/vendor/plugins/shoulda/lib/shoulda/gem/proc_extensions.rb