Class: Liquid2::BlockComment
- Defined in:
- lib/liquid2/nodes/tags/block_comment.rb
Overview
The standard comment tag.
Instance Attribute Summary collapse
-
#text ⇒ Object
readonly
Returns the value of attribute text.
Attributes inherited from Node
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(token, text) ⇒ BlockComment
constructor
A new instance of BlockComment.
- #render(_context, _buffer) ⇒ Object
Methods inherited from Tag
Methods inherited from Node
#block_scope, #children, #expressions, #partial_scope, #render_with_disabled_tag_check, #template_scope
Constructor Details
#initialize(token, text) ⇒ BlockComment
Returns a new instance of BlockComment.
19 20 21 22 |
# File 'lib/liquid2/nodes/tags/block_comment.rb', line 19 def initialize(token, text) super(token) @text = text end |
Instance Attribute Details
#text ⇒ Object (readonly)
Returns the value of attribute text.
8 9 10 |
# File 'lib/liquid2/nodes/tags/block_comment.rb', line 8 def text @text end |
Class Method Details
.parse(token, parser) ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/liquid2/nodes/tags/block_comment.rb', line 10 def self.parse(token, parser) parser.carry_whitespace_control parser.eat(:token_tag_end) comment = parser.eat(:token_comment) parser.eat_empty_tag("endcomment") new(token, comment[1] || raise) end |
Instance Method Details
#render(_context, _buffer) ⇒ Object
24 |
# File 'lib/liquid2/nodes/tags/block_comment.rb', line 24 def render(_context, _buffer) = 0 |