class ActiveSupport::Deprecation::DeprecatedObjectProxy
Default deprecator is ActiveSupport::Deprecation
trigger warn
method on deprecator_instance
.
When someone executes any method except inspect
on proxy object this will
@old_object = DeprecatedObjectProxy.new(Object.new, “Don’t use this object anymore!”, deprecator_instance)
@old_object = DeprecatedObjectProxy.new(Object.new, “Don’t use this object anymore!”)
This DeprecatedObjectProxy transforms object to deprecated object.
def initialize(object, message, deprecator = ActiveSupport::Deprecation.instance)
def initialize(object, message, deprecator = ActiveSupport::Deprecation.instance) @object = object @message = message @deprecator = deprecator end
def target
def target @object end
def warn(callstack, called, args)
def warn(callstack, called, args) @deprecator.warn(@message, callstack) end