Class: Occi::Core::Renderers::Text::Link

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

Overview

Implements methods needed to render link instances to text-based renderings. This class (its instances) is usually called directly from the “outside”. It utilizes `Category` and `Attributes` from this module to render kind, mixins, and instance attributes.

Author:

Constant Summary

Constants inherited from Base

Base::DELEGATED, Base::RENDER_SAFE

Instance Attribute Summary

Attributes inherited from Base

#object, #options

Instance Method Summary collapse

Methods inherited from Base

#initialize, #render, #render_safe, render_safe

Constructor Details

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

Instance Method Details

#render_headersHash

Renders `object` into text for headers and returns the result as `Hash`.

Returns:

  • (Hash)

    textual representation of Object for headers


29
30
31
32
33
34
35
# File 'lib/occi/core/renderers/text/link.rb', line 29

def render_headers
  headers = short_category(object.kind)
  headers[Category.category_key_headers].concat(
    short_mixins_headers
  )
  headers.merge(instance_attributes)
end

#render_plainString

Renders `object` into plain text and returns the result as `String`.

Returns:

  • (String)

    textual representation of Object


21
22
23
# File 'lib/occi/core/renderers/text/link.rb', line 21

def render_plain
  [short_category(object.kind), short_mixins_plain, instance_attributes].flatten.join("\n")
end