Class: Luoma::OutputStatement
- Defined in:
- lib/luoma/tags/output.rb,
sig/luoma/tags/output.rbs
Instance Attribute Summary
Attributes inherited from Markup
Instance Method Summary collapse
-
#expressions ⇒ ::Array[Expression]
() -> Array.
-
#initialize(token, expression) ⇒ OutputStatement
constructor
A new instance of OutputStatement.
-
#render(context, buffer) ⇒ void
(RenderContext, String) -> void.
Methods inherited from Markup
#block_scope, #children, #partial, #template_scope
Constructor Details
#initialize(token, expression) ⇒ OutputStatement
Returns a new instance of OutputStatement.
5 6 7 8 |
# File 'lib/luoma/tags/output.rb', line 5 def initialize(token, expression) super(token) @expression = expression end |
Instance Method Details
#expressions ⇒ ::Array[Expression]
() -> Array
16 17 18 |
# File 'lib/luoma/tags/output.rb', line 16 def expressions [@expression] end |
#render(context, buffer) ⇒ void
This method returns an undefined value.
(RenderContext, String) -> void
11 12 13 |
# File 'lib/luoma/tags/output.rb', line 11 def render(context, buffer) buffer << context.env.serialize(@expression.evaluate(context), context) end |