class Occi::Core::Renderers::Text::Attributes

Implements methods needed to render instance attributes to text-based renderings. This class (its instances) is usually called directly from other classes in this module and not from the “outside”.

@author Boris Parak <parak@cesnet.cz

Constants

ATTRIBUTE_KEY

Attribute key constant

IP_TYPES
JSONABLE_TYPES
PRIMITIVE_TYPES

Known primitive attribute value types

QUOTABLE_TYPES

Public Instance Methods

render_headers() click to toggle source

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

@return [Hash] textual representation of Object for headers

# File lib/occi/core/renderers/text/attributes.rb, line 34
def render_headers
  { ATTRIBUTE_KEY => prepare_instance_attributes }
end
render_plain() click to toggle source

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

@return [String] textual representation of Object

# File lib/occi/core/renderers/text/attributes.rb, line 26
def render_plain
  prepare_instance_attributes.collect { |attrb| "#{ATTRIBUTE_KEY}: #{attrb}" }.join("\n")
end