Class: Decode::Comment::Tag
Instance Attribute Summary collapse
-
#directive ⇒ Object
readonly
The directive that generated the tag.
Attributes inherited from Node
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(directive) ⇒ Tag
constructor
A new instance of Tag.
Methods inherited from Node
#add, #children?, #each, #text, #traverse
Constructor Details
#initialize(directive) ⇒ Tag
Returns a new instance of Tag.
41 42 43 |
# File 'lib/decode/comment/tag.rb', line 41 def initialize(directive) @directive = directive end |
Instance Attribute Details
#directive ⇒ Object (readonly)
The directive that generated the tag.
47 48 49 |
# File 'lib/decode/comment/tag.rb', line 47 def directive @directive end |
Class Method Details
.parse(directive, text, lines, tags, level = 0) ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/decode/comment/tag.rb', line 26 def self.parse(directive, text, lines, , level = 0) if match = self::PATTERN.match(text) node = self.build(directive, match) .parse(lines, level + 1) do |child| node.add(child) end return node else # Consume all nested nodes: .ignore(lines, level + 1) end end |