Class: Makanai::Template
- Inherits:
-
Object
- Object
- Makanai::Template
- Defined in:
- lib/makanai/template.rb
Instance Attribute Summary collapse
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
-
#initialize(path:) ⇒ Template
constructor
A new instance of Template.
- #render ⇒ Object
Constructor Details
#initialize(path:) ⇒ Template
Returns a new instance of Template.
7 8 9 |
# File 'lib/makanai/template.rb', line 7 def initialize(path:) @path = path end |
Instance Attribute Details
#path ⇒ Object (readonly)
Returns the value of attribute path.
11 12 13 |
# File 'lib/makanai/template.rb', line 11 def path @path end |
Instance Method Details
#render ⇒ Object
13 14 15 16 |
# File 'lib/makanai/template.rb', line 13 def render template_file = File.read(path) ERB.new(template_file).result end |