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.



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

#inspectObject



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

def inspect
  @target.inspect
end