Class: Occi::Core::Renderers::Json::Resource

Inherits:
Base
  • Object
show all
Includes:
Instance
Defined in:
lib/occi/core/renderers/json/resource.rb

Overview

Implements routines required to render `Occi::Core::Resource` and its subclasses to a JSON-based representation.

Author:

Constant Summary

Constants inherited from Base

Base::DELEGATED

Instance Attribute Summary

Attributes inherited from Base

#object, #options

Instance Method Summary collapse

Methods included from Instance

#render_attributes_hash, #render_instance_hash

Methods inherited from Base

#initialize, #render

Constructor Details

This class inherits a constructor from Occi::Core::Renderers::Json::Base

Instance Method Details

#render_hashObject

:nodoc:


17
18
19
20
21
22
# File 'lib/occi/core/renderers/json/resource.rb', line 17

def render_hash
  base = render_instance_hash
  base[:summary] = object_summary if object_summary
  base[:links] = object_links.collect { |l| Link.new(l, options).render_hash } unless object_links.blank?
  base
end