Class: Makanai::TemplateEngine::Haml
- Defined in:
- lib/makanai/template_engine/haml.rb
Instance Attribute Summary collapse
-
#locals ⇒ Object
readonly
Returns the value of attribute locals.
-
#text ⇒ Object
readonly
Returns the value of attribute text.
Instance Method Summary collapse
-
#initialize(text:, locals: {}) ⇒ Haml
constructor
A new instance of Haml.
- #result ⇒ Object
Constructor Details
#initialize(text:, locals: {}) ⇒ Haml
Returns a new instance of Haml.
9 10 11 12 13 |
# File 'lib/makanai/template_engine/haml.rb', line 9 def initialize(text:, locals: {}) super() @text = text @locals = locals end |
Instance Attribute Details
#locals ⇒ Object (readonly)
Returns the value of attribute locals.
15 16 17 |
# File 'lib/makanai/template_engine/haml.rb', line 15 def locals @locals end |
#text ⇒ Object (readonly)
Returns the value of attribute text.
15 16 17 |
# File 'lib/makanai/template_engine/haml.rb', line 15 def text @text end |
Instance Method Details
#result ⇒ Object
17 18 19 20 |
# File 'lib/makanai/template_engine/haml.rb', line 17 def result # ref: http://haml.info/docs/yardoc/Haml/Engine.html#render-instance_method ::Haml::Engine.new(text).render(Object.new, locals) end |