Class: ActiveSupport::Deprecation::DeprecatedObjectProxy
- Inherits:
-
DeprecationProxy
- Object
- DeprecationProxy
- ActiveSupport::Deprecation::DeprecatedObjectProxy
- Defined in:
- activesupport/lib/active_support/deprecation/proxy_wrappers.rb
Overview
This DeprecatedObjectProxy transforms object to deprecated object.
@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
Instance Method Summary collapse
-
#initialize(object, message, deprecator = ActiveSupport::Deprecation.instance) ⇒ DeprecatedObjectProxy
constructor
A new instance of DeprecatedObjectProxy.
Methods inherited from DeprecationProxy
Constructor Details
#initialize(object, message, deprecator = ActiveSupport::Deprecation.instance) ⇒ DeprecatedObjectProxy
Returns a new instance of DeprecatedObjectProxy.
38 39 40 41 42 |
# File 'activesupport/lib/active_support/deprecation/proxy_wrappers.rb', line 38 def initialize(object, , deprecator = ActiveSupport::Deprecation.instance) @object = object @message = @deprecator = deprecator end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class ActiveSupport::Deprecation::DeprecationProxy