Class: Chef::Mixin::Deprecation::DeprecatedInstanceVariable

Inherits:
DeprecatedObjectProxyBase show all
Defined in:
lib/chef/mixin/deprecation.rb

Constant Summary

Constants inherited from DeprecatedObjectProxyBase

Chef::Mixin::Deprecation::DeprecatedObjectProxyBase::KEEPERS

Instance Method Summary collapse

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

#inspectObject


72
73
74
# File 'lib/chef/mixin/deprecation.rb', line 72

def inspect
  @target.inspect
end