Class: Rndr::Template
- Inherits:
-
Object
- Object
- Rndr::Template
- Defined in:
- lib/rndr/template.rb
Overview
This class is used to handle the rendering of ERB
templates.
Instance Method Summary collapse
-
#initialize(path:, vars: {}) ⇒ Template
constructor
Constructs a new instance of Template.
-
#render(render_path) ⇒ Boolean
Renders the template to the supplied path.
-
#render? ⇒ Boolean
Verifies if a template is renderable or not.
Constructor Details
#initialize(path:, vars: {}) ⇒ Template
Constructs a new instance of Template.
12 13 14 15 |
# File 'lib/rndr/template.rb', line 12 def initialize(path:, vars: {}) @path = File.absolute_path(path) @vars = vars end |
Instance Method Details
#render(render_path) ⇒ Boolean
Renders the template to the supplied path.
26 27 28 |
# File 'lib/rndr/template.rb', line 26 def render(render_path) render_helper(render_path) end |
#render? ⇒ Boolean
Verifies if a template is renderable or not.
19 20 21 |
# File 'lib/rndr/template.rb', line 19 def render? render_helper end |