Class: Chef::Mixin::Deprecation::DeprecatedInstanceVariable
- Inherits:
-
DeprecatedObjectProxyBase
- Object
- DeprecatedObjectProxyBase
- Chef::Mixin::Deprecation::DeprecatedInstanceVariable
- Defined in:
- lib/chef/mixin/deprecation.rb
Constant Summary
Constants inherited from DeprecatedObjectProxyBase
Chef::Mixin::Deprecation::DeprecatedObjectProxyBase::KEEPERS
Instance Method Summary collapse
-
#initialize(target, ivar_name, level = nil) ⇒ DeprecatedInstanceVariable
constructor
A new instance of DeprecatedInstanceVariable.
- #inspect ⇒ Object
- #method_missing(method_name, *args, &block) ⇒ Object
Constructor Details
#initialize(target, ivar_name, level = nil) ⇒ DeprecatedInstanceVariable
Returns a new instance of DeprecatedInstanceVariable.
62 63 64 65 |
# File 'lib/chef/mixin/deprecation.rb', line 62 def initialize(target, ivar_name, level = nil) @target, @ivar_name = target, ivar_name @level ||= :warn end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_name, *args, &block) ⇒ Object
67 68 69 70 |
# File 'lib/chef/mixin/deprecation.rb', line 67 def method_missing(method_name, *args, &block) deprecated_msg(caller[0..3]) @target.send(method_name, *args, &block) end |
Instance Method Details
#inspect ⇒ Object
72 73 74 |
# File 'lib/chef/mixin/deprecation.rb', line 72 def inspect @target.inspect end |