Implements routines required to render `Occi::Core::Locations` and its subclasses to a text-based representation. Supports rendering to plain and header-like formats.
@author Boris Parak <parak@cesnet.cz>
Location key constants
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/locations.rb, line 30 def render_headers return {} if object.empty? { LOCATION_KEY_HEADERS => location_ary_or_first } end
Renders `object` into plain text and returns the result as `String`.
@return [String] textual representation of Object
# File lib/occi/core/renderers/text/locations.rb, line 21 def render_plain locs = object.map { |loc| "#{LOCATION_KEY_PLAIN}: #{loc}" } locs.join "\n" end