Method: Chef::DataBagItem#to_json

Defined in:
lib/chef/data_bag_item.rb

#to_json(*a) ⇒ Object

Serialize this object as a hash



124
125
126
127
128
129
130
131
132
133
# File 'lib/chef/data_bag_item.rb', line 124

def to_json(*a)
  result = {
    "name" => object_name,
    "json_class" => self.class.name,
    "chef_type" => "data_bag_item",
    "data_bag" => data_bag,
    "raw_data" => raw_data,
  }
  Chef::JSONCompat.to_json(result, *a)
end