Class: Prmd::Renderer

Inherits:
Object
  • Object
show all
Defined in:
lib/prmd/core/renderer.rb

Overview

Schema Generator

Instance Method Summary collapse

Constructor Details

#initialize(properties = {}) ⇒ Renderer

Returns a new instance of Renderer.

Parameters:

  • properties (Hash<Symbol, Object>) (defaults to: {})


9
10
11
12
# File 'lib/prmd/core/renderer.rb', line 9

def initialize(properties = {})
  @properties = properties
  @template = @properties.fetch(:template)
end

Instance Method Details

#render(schema, options = {}) ⇒ Object

Parameters:

  • schema (Prmd::Schema)
  • options (Hash<Symbol, Object>) (defaults to: {})


48
49
50
# File 'lib/prmd/core/renderer.rb', line 48

def render(schema, options = {})
  @template.result(schema: schema, options: setup_options(options))
end