Class: Proforma::HtmlRenderer
- Inherits:
-
Object
- Object
- Proforma::HtmlRenderer
- Defined in:
- lib/proforma/html_renderer.rb,
lib/proforma/html_renderer/writer.rb,
lib/proforma/html_renderer/version.rb,
lib/proforma/html_renderer/object_writer.rb,
lib/proforma/html_renderer/proforma_writer.rb
Overview
This main class to use as a Proforma renderer.
Defined Under Namespace
Classes: ObjectWriter, ProformaWriter, Writer
Constant Summary collapse
- EXTENSION =
'.html'
- DEFAULT_OPTIONS =
{ bold_weight: 'bold', font_family: 'sans-serif', header_font_size: 18, line_height_increase: 5, text_font_size: 13 }.freeze
- VERSION =
'1.0.1'
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ HtmlRenderer
constructor
A new instance of HtmlRenderer.
- #render(prototype) ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ HtmlRenderer
Returns a new instance of HtmlRenderer.
33 34 35 |
# File 'lib/proforma/html_renderer.rb', line 33 def initialize( = {}) @options = OpenStruct.new(DEFAULT_OPTIONS.merge()) end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
31 32 33 |
# File 'lib/proforma/html_renderer.rb', line 31 def @options end |
Instance Method Details
#render(prototype) ⇒ Object
37 38 39 40 41 42 43 44 45 |
# File 'lib/proforma/html_renderer.rb', line 37 def render(prototype) contents = ProformaWriter.render(prototype, ) Proforma::Document.new( contents: contents, extension: EXTENSION, title: prototype.title ) end |