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.
63 64 65 66 |
# File 'lib/chef/mixin/deprecation.rb', line 63 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
68 69 70 71 |
# File 'lib/chef/mixin/deprecation.rb', line 68 def method_missing(method_name, *args, &block) log_deprecation_msg(caller[0..3]) @target.send(method_name, *args, &block) end |
Instance Method Details
#inspect ⇒ Object
73 74 75 |
# File 'lib/chef/mixin/deprecation.rb', line 73 def inspect @target.inspect end |