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