Method: Chef::Node::Mixin::DeepMergeCache#reset_cache

Defined in:
lib/chef/node/mixin/deep_merge_cache.rb

#reset_cache(path = nil) ⇒ Object Also known as: reset

Invalidate a key in the deep_merge_cache. If called with nil, or no arg, this will invalidate the entire deep_merge cache. In the case of the user doing node.default[‘bar’]= that eventually results in a call to reset_cache(’foo’) here. A node.default=hash_thing call must invalidate the entire cache and re-deep-merge the entire node object.



40
41
42
43
44
45
46
# File 'lib/chef/node/mixin/deep_merge_cache.rb', line 40

def reset_cache(path = nil)
  if path.nil?
    deep_merge_cache.regular_clear
  else
    deep_merge_cache.regular_delete(path.to_s)
  end
end