Class: Liquid2::Output
Overview
The AST node representing output statements.
Instance Attribute Summary collapse
-
#expression ⇒ Object
readonly
Returns the value of attribute expression.
Attributes inherited from Node
Instance Method Summary collapse
- #expressions ⇒ Object
-
#initialize(token, expression) ⇒ Output
constructor
A new instance of Output.
- #render(context, buffer) ⇒ Object
Methods inherited from Node
#block_scope, #children, #partial_scope, #render_with_disabled_tag_check, #template_scope
Constructor Details
#initialize(token, expression) ⇒ Output
Returns a new instance of Output.
12 13 14 15 16 |
# File 'lib/liquid2/nodes/output.rb', line 12 def initialize(token, expression) super(token) @expression = expression @blank = false end |
Instance Attribute Details
#expression ⇒ Object (readonly)
Returns the value of attribute expression.
8 9 10 |
# File 'lib/liquid2/nodes/output.rb', line 8 def expression @expression end |
Instance Method Details
#expressions ⇒ Object
22 |
# File 'lib/liquid2/nodes/output.rb', line 22 def expressions = [@expression] |
#render(context, buffer) ⇒ Object
18 19 20 |
# File 'lib/liquid2/nodes/output.rb', line 18 def render(context, buffer) buffer << Liquid2.to_output_s(@expression.evaluate(context)) end |