Class: Liquid2::DocTag

Inherits:
Tag show all
Defined in:
lib/liquid2/nodes/tags/doc.rb

Overview

The standard doc tag.

Instance Attribute Summary collapse

Attributes inherited from Node

#blank, #token

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Tag

#name

Methods inherited from Node

#block_scope, #children, #expressions, #partial_scope, #render_with_disabled_tag_check, #template_scope

Constructor Details

#initialize(token, text) ⇒ DocTag

Returns a new instance of DocTag.

Parameters:

  • text (String)


19
20
21
22
# File 'lib/liquid2/nodes/tags/doc.rb', line 19

def initialize(token, text)
  super(token)
  @text = text
end

Instance Attribute Details

#textObject (readonly)

Returns the value of attribute text.



8
9
10
# File 'lib/liquid2/nodes/tags/doc.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/doc.rb', line 10

def self.parse(token, parser)
  parser.carry_whitespace_control
  parser.eat(:token_tag_end)
  text_token = parser.eat(:token_doc)
  parser.eat_empty_tag("enddoc")
  new(token, text_token[1] || raise)
end

Instance Method Details

#render(_context, _buffer) ⇒ Object



24
# File 'lib/liquid2/nodes/tags/doc.rb', line 24

def render(_context, _buffer) = 0