Class: Occi::Core::Renderers::TextRenderer
- Inherits:
-
BaseRenderer
- Object
- BaseRenderer
- Occi::Core::Renderers::TextRenderer
- Defined in:
- lib/occi/core/renderers/text_renderer.rb
Overview
Implementes components necessary to render all required instance types to ‘text` or `text`-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::Text`.
Constant Summary collapse
- TEXT_FORMATS =
Supported formats
%w[text text_plain text_occi headers].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/text_renderer.rb', line 50 def formats TEXT_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/text_renderer.rb', line 58 def known { 'Occi::Core::Category' => Occi::Core::Renderers::Text::Category, 'Occi::Core::ActionInstance' => Occi::Core::Renderers::Text::ActionInstance, 'Occi::Core::Collection' => Occi::Core::Renderers::Text::Collection, 'Occi::Core::Model' => Occi::Core::Renderers::Text::Model, 'Occi::Core::Resource' => Occi::Core::Renderers::Text::Resource, 'Occi::Core::Link' => Occi::Core::Renderers::Text::Link, 'Occi::Core::Locations' => Occi::Core::Renderers::Text::Locations } end |
.renderer? ⇒ TrueClass, FalseClass
Indicates whether this class is a renderer candidate.
41 42 43 |
# File 'lib/occi/core/renderers/text_renderer.rb', line 41 def renderer? true end |