Class: Liquid2::Block
Overview
An node representing a block of Liquid markup. Essentially an array of other nodes and strings.
Instance Attribute Summary
Attributes inherited from Node
Instance Method Summary collapse
- #children(_static_context, include_partials: true) ⇒ Object
-
#initialize(token, nodes) ⇒ Block
constructor
A new instance of Block.
- #render(context, buffer) ⇒ Object
Methods inherited from Node
#block_scope, #expressions, #partial_scope, #render_with_disabled_tag_check, #template_scope
Constructor Details
Instance Method Details
#children(_static_context, include_partials: true) ⇒ Object
91 |
# File 'lib/liquid2/node.rb', line 91 def children(_static_context, include_partials: true) = @nodes |
#render(context, buffer) ⇒ Object
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 |
# File 'lib/liquid2/node.rb', line 74 def render(context, buffer) buffer = +"" if context.env.suppress_blank_control_flow_blocks && @blank index = 0 while (node = @nodes[index]) index += 1 case node when String buffer << node else node.render_with_disabled_tag_check(context, buffer) end context.raise_for_output_limit(buffer.bytesize) return unless context.interrupts.empty? end end |