Class: Verto::Template
- Inherits:
-
Object
- Object
- Verto::Template
- Defined in:
- lib/verto/utils/template.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(template_name) ⇒ Template
constructor
A new instance of Template.
- #render(to:) ⇒ Object
Constructor Details
#initialize(template_name) ⇒ Template
Returns a new instance of Template.
9 10 11 |
# File 'lib/verto/utils/template.rb', line 9 def initialize(template_name) @template_name = template_name end |
Class Method Details
.render(template_name, to:) ⇒ Object
5 6 7 |
# File 'lib/verto/utils/template.rb', line 5 def self.render(template_name, to:) new(template_name).render(to: to) end |
Instance Method Details
#render(to:) ⇒ Object
13 14 15 16 |
# File 'lib/verto/utils/template.rb', line 13 def render(to:) path = Pathname.new(to) path.join(@template_name).write(template_content) end |