Method: Chef::Node#to_json

Defined in:
lib/chef/node.rb

#to_json(*a) ⇒ Object

Serialize this object as a hash



323
324
325
326
327
328
329
330
331
332
333
334
335
# File 'lib/chef/node.rb', line 323

def to_json(*a)
  result = {
    "name" => @name,
    'json_class' => self.class.name,
    "attributes" => @attribute,
    "chef_type" => "node",
    "defaults" => @default_attrs,
    "overrides" => @override_attrs,
    "run_list" => @run_list.run_list,
  }
  result["_rev"] = @couchdb_rev if @couchdb_rev
  result.to_json(*a)
end