Class: Occi::Core::Renderers::JsonRenderer
- Inherits:
-
BaseRenderer
- Object
- BaseRenderer
- Occi::Core::Renderers::JsonRenderer
- Defined in:
- lib/occi/core/renderers/json_renderer.rb
Overview
Implementes components necessary to render all required instance types to ‘JSON` or `JSON`-like format. Currently supported instance types can be queried via `::known_types`. Actual serialization happens in type-specific serializer classes which can be found in `Occi::Core::Renderers::Json`.
Constant Summary collapse
- JSON_FORMATS =
Supported formats
%w[json occi_json json_occi].freeze
Class Method Summary collapse
-
.formats ⇒ Array
Returns a list of formats supported by this renderer.
-
.known ⇒ Array
Returns a frozen Hash providing mapping information between supported types and supported serializers.
-
.renderer? ⇒ TrueClass, FalseClass
Indicates whether this class is a renderer candidate.
Methods inherited from BaseRenderer
known_serializers, known_types, render
Class Method Details
.formats ⇒ Array
Returns a list of formats supported by this renderer. Formats are compliant with method naming restrictions and String-like.
50 51 52 |
# File 'lib/occi/core/renderers/json_renderer.rb', line 50 def formats JSON_FORMATS end |
.known ⇒ Array
Returns a frozen Hash providing mapping information between supported types and supported serializers.
58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/occi/core/renderers/json_renderer.rb', line 58 def known { 'Occi::Core::Category' => Occi::Core::Renderers::Json::Category, 'Occi::Core::ActionInstance' => Occi::Core::Renderers::Json::ActionInstance, 'Occi::Core::Collection' => Occi::Core::Renderers::Json::Collection, 'Occi::Core::Model' => Occi::Core::Renderers::Json::Model, 'Occi::Core::Resource' => Occi::Core::Renderers::Json::Resource, 'Occi::Core::Link' => Occi::Core::Renderers::Json::Link, 'Occi::Core::Locations' => Occi::Core::Renderers::Json::Locations } end |
.renderer? ⇒ TrueClass, FalseClass
Indicates whether this class is a renderer candidate.
41 42 43 |
# File 'lib/occi/core/renderers/json_renderer.rb', line 41 def renderer? true end |