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



28
29
30
31
# File 'lib/chef/mixin/deprecation.rb', line 28

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



33
34
35
36
# File 'lib/chef/mixin/deprecation.rb', line 33

def method_missing(method_name, *args, &block)
  log_deprecation_msg(caller[0..3])
  @target.send(method_name, *args, &block)
end

Instance Method Details

#inspectObject



38
39
40
# File 'lib/chef/mixin/deprecation.rb', line 38

def inspect
  @target.inspect
end