Class: Occi::Core::Renderers::Json::Resource
- 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.
Constant Summary
Constants inherited from Base
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#render_hash ⇒ Object
:nodoc:.
Methods included from Instance
#render_attributes_hash, #render_instance_hash
Methods inherited from Base
Constructor Details
This class inherits a constructor from Occi::Core::Renderers::Json::Base
Instance Method Details
#render_hash ⇒ Object
: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, ).render_hash } unless object_links.blank? base end |