Class: AdHocTemplate::EntryFormatGenerator::LabelChecker
- Inherits:
-
Object
- Object
- AdHocTemplate::EntryFormatGenerator::LabelChecker
- Defined in:
- lib/ad_hoc_template/entry_format_generator.rb
Instance Attribute Summary collapse
-
#labels ⇒ Object
readonly
Returns the value of attribute labels.
Instance Method Summary collapse
-
#initialize ⇒ LabelChecker
constructor
A new instance of LabelChecker.
- #visit(tree, memo) ⇒ Object
Constructor Details
#initialize ⇒ LabelChecker
Returns a new instance of LabelChecker.
9 10 11 |
# File 'lib/ad_hoc_template/entry_format_generator.rb', line 9 def initialize @labels = {} end |
Instance Attribute Details
#labels ⇒ Object (readonly)
Returns the value of attribute labels.
8 9 10 |
# File 'lib/ad_hoc_template/entry_format_generator.rb', line 8 def labels @labels end |
Instance Method Details
#visit(tree, memo) ⇒ Object
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/ad_hoc_template/entry_format_generator.rb', line 13 def visit(tree, memo) case tree when Parser::IterationNode, Parser::FallbackNode visit_iteration_tag_node(tree, memo) when Parser::TagNode @labels[tree.join.strip] = nil when Parser::Node tree.each {|node| node.accept(self, memo) } end end |