Class: Chef::Knife::Scrub::AttributeExtractor::Weird

Inherits:
Base
  • Object
show all
Defined in:
lib/chef/knife/scrub/attribute_extractor.rb

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Chef::Knife::Scrub::AttributeExtractor::Base

Instance Method Details

#delete(path) ⇒ Object



99
100
101
102
# File 'lib/chef/knife/scrub/attribute_extractor.rb', line 99

def delete(path)
  base, key = extract(attributes, path)
  base.delete_from_component(base.send(@precedence), key)
end

#fetch(path) ⇒ Object



94
95
96
97
# File 'lib/chef/knife/scrub/attribute_extractor.rb', line 94

def fetch(path)
  base, key = extract(attributes, path)
  base.value_at_current_nesting(base.send(@precedence), key).fetch(key)
end

#has_key?(path) ⇒ Boolean

Returns:

  • (Boolean)


89
90
91
92
# File 'lib/chef/knife/scrub/attribute_extractor.rb', line 89

def has_key?(path)
  base, key = extract(attributes, path)
  !base.nil? && base.component_has_key?(base.send(@precedence), key)
end