Method: Chef::Node::Attribute#read
- Defined in:
- lib/chef/node/attribute.rb
#read(*path) ⇒ Object Also known as: dig
method-style access to attributes (has to come after the prepended ImmutablizeHash)
454 455 456 457 458 459 460 461 462 |
# File 'lib/chef/node/attribute.rb', line 454 def read(*path) if path[0].nil? Chef::Log.warn "Calling node.read() without any path argument is very slow, probably a bug, and should be avoided" merged_attributes.read(*path) # re-merges everything, slow edge case else self[path[0]] unless path[0].nil? # force deep_merge_cache key construction if necessary deep_merge_cache.read(*path) end end |