Method: Chef::ResourceCollection#to_json
- Defined in:
- lib/chef/resource_collection.rb
#to_json(*a) ⇒ Object
Serialize this object as a hash
158 159 160 161 162 163 164 165 166 167 168 |
# File 'lib/chef/resource_collection.rb', line 158 def to_json(*a) instance_vars = Hash.new self.instance_variables.each do |iv| instance_vars[iv] = self.instance_variable_get(iv) end results = { 'json_class' => self.class.name, 'instance_vars' => instance_vars } results.to_json(*a) end |