Class: FacturaePrint::Renderers::HTMLRenderer
- Inherits:
-
Object
- Object
- FacturaePrint::Renderers::HTMLRenderer
- Defined in:
- lib/facturae_print/renderers/html_renderer.rb
Instance Method Summary collapse
-
#initialize(template, invoice) ⇒ HTMLRenderer
constructor
A new instance of HTMLRenderer.
- #render ⇒ Object
Constructor Details
#initialize(template, invoice) ⇒ HTMLRenderer
Returns a new instance of HTMLRenderer.
7 8 9 10 |
# File 'lib/facturae_print/renderers/html_renderer.rb', line 7 def initialize(template, invoice) @template = template @invoice = invoice end |
Instance Method Details
#render ⇒ Object
12 13 14 15 16 17 18 19 20 |
# File 'lib/facturae_print/renderers/html_renderer.rb', line 12 def render eruby = Erubis::Eruby.new(@template) __context = Erubis::Context.new class << __context include FacturaePrint::Renderers::HTMLRendererHelpers end __context[:invoice] = @invoice eruby.evaluate(__context) end |