Class: Luoma::OutputStatement

Inherits:
Markup
  • Object
show all
Defined in:
lib/luoma/tags/output.rb,
sig/luoma/tags/output.rbs

Instance Attribute Summary

Attributes inherited from Markup

#blank, #tag_name, #token

Instance Method Summary collapse

Methods inherited from Markup

#block_scope, #children, #partial, #template_scope

Constructor Details

#initialize(token, expression) ⇒ OutputStatement

Returns a new instance of OutputStatement.

Parameters:



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

Returns:



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

Parameters:



11
12
13
# File 'lib/luoma/tags/output.rb', line 11

def render(context, buffer)
  buffer << context.env.serialize(@expression.evaluate(context), context)
end