class ActiveSupport::Deprecation::DeprecatedObjectProxy
# => “#<Object:0x007fb9b34c34b0>”
(Backtrace)
DEPRECATION WARNING: This object is now deprecated.
deprecated_object.to_s
# => #<Object:0x007fb9b34c34b0>
deprecated_object = ActiveSupport::Deprecation::DeprecatedObjectProxy.new(Object.new, “This object is now deprecated”, ActiveSupport::Deprecation.new)
a deprecator.
DeprecatedObjectProxy transforms an object into a deprecated one. It takes an object, a deprecation message, and
def initialize(object, message, deprecator = nil)
def initialize(object, message, deprecator = nil) @object = object @message = message ActiveSupport.deprecator.warn("DeprecatedObjectProxy without a deprecator is deprecated") unless deprecator @deprecator = deprecator || ActiveSupport::Deprecation._instance end
def target
def target @object end
def warn(callstack, called, args)
def warn(callstack, called, args) @deprecator.warn(@message, callstack) end