class Occi::Core::Renderers::Json::Base

Implements methods common to all JSON-based renderers. This class is not meant to be used directly, only as a parent to other type-specific rendering classes.

@attr object [Object] instance to be rendered @attr options [Hash] additional rendering options

@author Boris Parak <parak@cesnet.cz

Constants

DELEGATED

Shortcuts to interesting object attributes, always prefixed with `object_`

Attributes

object[RW]
options[RW]

Public Class Methods

new(object, options) click to toggle source

Constructs a renderer instance for the given object.

@param object [Object] instance to be rendered @param options [Hash] additional options

# File lib/occi/core/renderers/json/base.rb, line 31
def initialize(object, options)
  @object = object
  @options = options
end

Public Instance Methods

render() click to toggle source

Renders the given object to `JSON`.

@return [String] object rendering as JSON

# File lib/occi/core/renderers/json/base.rb, line 39
def render
  render_hash.to_json
end