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
dirty_history-0.4.3 dirty_history/ruby/1.9.1/gems/shoulda-2.11.3/lib/shoulda/proc_extensions.rb
dirty_history-0.4.2 dirty_history/ruby/1.9.1/gems/dirty_history-0.2.0/dirty_history/ruby/1.9.1/gems/shoulda-2.11.3/lib/shoulda/proc_extensions.rb
dirty_history-0.4.2 dirty_history/ruby/1.9.1/gems/shoulda-2.11.3/lib/shoulda/proc_extensions.rb
dirty_history-0.4.2 dirty_history/ruby/1.9.1/gems/dirty_history-0.2.0/dirty_history/ruby/1.9.1/gems/dirty_history-0.2.0/dirty_history/ruby/1.9.1/gems/shoulda-2.11.3/lib/shoulda/proc_extensions.rb
shoulda-context-1.0.0 lib/shoulda/context/proc_extensions.rb
spree-0.11.3 vendor/plugins/resource_controller/test/vendor/plugins/shoulda/lib/shoulda/gem/proc_extensions.rb
dirty_history-0.3.0 dirty_history/ruby/1.9.1/gems/shoulda-2.11.3/lib/shoulda/proc_extensions.rb
dirty_history-0.3.0 dirty_history/ruby/1.9.1/gems/dirty_history-0.2.0/dirty_history/ruby/1.9.1/gems/shoulda-2.11.3/lib/shoulda/proc_extensions.rb
dirty_history-0.3.0 dirty_history/ruby/1.9.1/gems/dirty_history-0.2.0/dirty_history/ruby/1.9.1/gems/dirty_history-0.2.0/dirty_history/ruby/1.9.1/gems/shoulda-2.11.3/lib/shoulda/proc_extensions.rb
dirty_history-0.2.0 dirty_history/ruby/1.9.1/gems/shoulda-2.11.3/lib/shoulda/proc_extensions.rb
dirty_history-0.2.0 dirty_history/ruby/1.9.1/gems/dirty_history-0.2.0/dirty_history/ruby/1.9.1/gems/shoulda-2.11.3/lib/shoulda/proc_extensions.rb
vanity-1.7.1 vendor/ruby/1.9.1/gems/shoulda-2.11.3/lib/shoulda/proc_extensions.rb
faster_shoulda-2.11.3 lib/shoulda/proc_extensions.rb
dirty_history-0.1.3 dirty_history/ruby/1.9.1/gems/shoulda-2.11.3/lib/shoulda/proc_extensions.rb
nimboids-shoulda-2.11.4 lib/shoulda/proc_extensions.rb
shoulda-context-1.0.0.beta1 lib/shoulda/context/proc_extensions.rb
putio-0.0.1.pre2 development/ruby/1.8/gems/shoulda-2.11.3/lib/shoulda/proc_extensions.rb
putio-0.0.1.pre development/ruby/1.8/gems/shoulda-2.11.3/lib/shoulda/proc_extensions.rb
nimboids-shoulda-2.11.3 lib/shoulda/proc_extensions.rb
shoulda-2.11.3 lib/shoulda/proc_extensions.rb