Sha256: 4c501aa758322919c58c33c5557ef4656ad019d961492d4668cecca8a3145479

Contents?: true

Size: 511 Bytes

Versions: 30

Compression:

Stored size: 511 Bytes

Contents

require "active_support/core_ext/kernel/singleton_class"
require "active_support/deprecation"

class Proc #:nodoc:
  def bind(object)
    ActiveSupport::Deprecation.warn 'Proc#bind is deprecated and will be removed in future versions'

    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

Version data entries

30 entries across 30 versions & 2 rubygems

Version Path
activesupport-4.0.13 lib/active_support/core_ext/proc.rb
activesupport-4.0.13.rc1 lib/active_support/core_ext/proc.rb
activesupport-4.0.11.1 lib/active_support/core_ext/proc.rb
activesupport-4.0.12 lib/active_support/core_ext/proc.rb
activesupport-4.0.11 lib/active_support/core_ext/proc.rb
activesupport-4.0.10 lib/active_support/core_ext/proc.rb
activesupport-4.0.10.rc2 lib/active_support/core_ext/proc.rb
activesupport-4.0.10.rc1 lib/active_support/core_ext/proc.rb
activesupport-4.0.9 lib/active_support/core_ext/proc.rb
activesupport-4.0.8 lib/active_support/core_ext/proc.rb
activesupport-4.0.7 lib/active_support/core_ext/proc.rb
activesupport-4.0.6 lib/active_support/core_ext/proc.rb
activesupport-4.0.6.rc3 lib/active_support/core_ext/proc.rb
activesupport-4.0.6.rc2 lib/active_support/core_ext/proc.rb
activesupport-4.0.6.rc1 lib/active_support/core_ext/proc.rb
activesupport-4.0.5 lib/active_support/core_ext/proc.rb
activesupport-4.0.4 lib/active_support/core_ext/proc.rb
activesupport-4.0.4.rc1 lib/active_support/core_ext/proc.rb
activesupport-4.0.3 lib/active_support/core_ext/proc.rb
activesupport-4.0.2 lib/active_support/core_ext/proc.rb