Type:
Class

This DeprecatedObjectProxy transforms object to deprecated object.

1
2
@old_object = DeprecatedObjectProxy.new(Object.new, "Don't use this object anymore!")
@old_object = DeprecatedObjectProxy.new(Object.new, "Don't use this object anymore!", deprecator_instance)

When someone executes any method except inspect on proxy object this will trigger warn method on deprecator_instance.

Default deprecator is ActiveSupport::Deprecation

new
  • References/Ruby on Rails/Rails/Classes/ActiveSupport/ActiveSupport::Deprecation/ActiveSupport::Deprecation::DeprecatedObjectProxy

new(object, message, deprecator = ActiveSupport::Deprecation.instance) Class Public methods

2025-01-10 15:47:30