Class: Occi::Core::Renderers::Json::Model
- Defined in:
- lib/occi/core/renderers/json/model.rb
Overview
Implements routines required to render ‘Occi::Core::Model` and its subclasses to a JSON-based representation.
Direct Known Subclasses
Constant Summary
Constants inherited from Base
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#render_hash ⇒ Object
:nodoc:.
Methods inherited from Base
Constructor Details
This class inherits a constructor from Occi::Core::Renderers::Json::Base
Instance Method Details
#render_hash ⇒ Object
:nodoc:
14 15 16 17 18 19 20 21 |
# File 'lib/occi/core/renderers/json/model.rb', line 14 def render_hash hsh = {} %i[actions kinds mixins].each do |symbol| next if object_send(symbol).blank? hsh[symbol] = object_send(symbol).collect { |k| Category.new(k, ).render_hash } end hsh end |