Class: Liquid::Echo
Overview
Echo outputs an expression
{% echo monkey %}
{% echo user.name %}
This is identical to variable output syntax, like foo }, but works inside liquid % tags. The full syntax is supported, including filters:
{% echo user | link %}
Defined Under Namespace
Classes: ParseTreeVisitor
Instance Attribute Summary collapse
-
#variable ⇒ Object
readonly
Returns the value of attribute variable.
Attributes inherited from Tag
#line_number, #nodelist, #parse_context, #tag_name
Instance Method Summary collapse
-
#initialize(tag_name, markup, parse_context) ⇒ Echo
constructor
A new instance of Echo.
- #render(context) ⇒ Object
Methods inherited from Tag
#blank?, disable_tags, #name, parse, #parse, #raw, #render_to_output_buffer
Methods included from ParserSwitching
#parse_with_selected_parser, #strict_parse_with_error_mode_fallback
Constructor Details
Instance Attribute Details
#variable ⇒ Object (readonly)
Returns the value of attribute variable.
15 16 17 |
# File 'lib/liquid/tags/echo.rb', line 15 def variable @variable end |
Instance Method Details
#render(context) ⇒ Object
22 23 24 |
# File 'lib/liquid/tags/echo.rb', line 22 def render(context) @variable.render_to_output_buffer(context, +'') end |