Method: Chef::Node#to_hash

Defined in:
lib/chef/node.rb

#to_hashObject

Transform the node to a Hash



518
519
520
521
522
523
524
525
526
527
# File 'lib/chef/node.rb', line 518

def to_hash
  index_hash = attributes.to_hash
  index_hash["chef_type"] = "node"
  index_hash["name"] = name
  index_hash["chef_environment"] = chef_environment
  index_hash["recipe"] = run_list.recipe_names if run_list.recipe_names.length > 0
  index_hash["role"] = run_list.role_names if run_list.role_names.length > 0
  index_hash["run_list"] = run_list.run_list_items
  index_hash
end