Method: Chef::Node::CommonAPI#read!

Defined in:
lib/chef/node/common_api.rb

#read!(*path) ⇒ Object

non-autovivifying reader that throws an exception if the attribute does not exist



104
105
106
107
108
109
110
# File 'lib/chef/node/common_api.rb', line 104

def read!(*path)
  raise Chef::Exceptions::NoSuchAttribute.new(path.join ".") unless exist?(*path)

  path.inject(self) do |memo, key|
    memo[key]
  end
end