Class: CoreExt::Deprecation::DeprecatedObjectProxy
- Inherits:
-
DeprecationProxy
- Object
- DeprecationProxy
- CoreExt::Deprecation::DeprecatedObjectProxy
- Defined in:
- lib/core_ext/deprecation/proxy_wrappers.rb
Overview
DeprecatedObjectProxy transforms an object into a deprecated one. It takes an object, a deprecation message and optionally a deprecator. The deprecator defaults to CoreExt::Deprecator
if none is specified.
deprecated_object = CoreExt::Deprecation::DeprecatedObjectProxy.new(Object.new, "This object is now deprecated")
# => #<Object:0x007fb9b34c34b0>
deprecated_object.to_s
DEPRECATION WARNING: This object is now deprecated.
(Backtrace)
# => "#<Object:0x007fb9b34c34b0>"
Instance Method Summary collapse
-
#initialize(object, message, deprecator = CoreExt::Deprecation.instance) ⇒ DeprecatedObjectProxy
constructor
A new instance of DeprecatedObjectProxy.
Methods inherited from DeprecationProxy
Constructor Details
#initialize(object, message, deprecator = CoreExt::Deprecation.instance) ⇒ DeprecatedObjectProxy
Returns a new instance of DeprecatedObjectProxy.
40 41 42 43 44 |
# File 'lib/core_ext/deprecation/proxy_wrappers.rb', line 40 def initialize(object, , deprecator = CoreExt::Deprecation.instance) @object = object @message = @deprecator = deprecator end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class CoreExt::Deprecation::DeprecationProxy