Class: BuildTool::Cfg::ListVisitor
- Inherits:
-
MJ::VisitorBase
- Object
- MJ::VisitorBase
- BuildTool::Cfg::ListVisitor
- Defined in:
- lib/build-tool/cfg/visitor.rb
Overview
Base class for all Visitors which need to iterate over their child nodes.
Direct Known Subclasses
ArchiveDeclarationNodeVisitor, BazarDeclarationNodeVisitor, BuildSystemDeclarationNodeVisitor, EnvironmentDeclarationNodeVisitor, GitOptionsDeclarationNodeVisitor, GitRemoteDeclarationNodeVisitor, IncludeNodeVisitor, MercurialDeclarationNodeVisitor, ModuleDeclarationNodeVisitor, RepositoryDeclarationNodeVisitor, ServerDeclarationNodeVisitor, SshKeyDeclarationNodeVisitor, StatementVisitor, SvnDeclarationNodeVisitor
Instance Attribute Summary
Attributes inherited from MJ::VisitorBase
Instance Method Summary collapse
-
#visit(node) ⇒ Object
Visit one node.
-
#visit_nodes(nodes) ⇒ Object
Visit all nodes.
Methods inherited from MJ::VisitorBase
Constructor Details
This class inherits a constructor from MJ::VisitorBase
Instance Method Details
#visit(node) ⇒ Object
Visit one node.
21 22 23 |
# File 'lib/build-tool/cfg/visitor.rb', line 21 def visit( node ) return self.visit_nodes( node.values ) end |
#visit_nodes(nodes) ⇒ Object
Visit all nodes.
26 27 28 29 30 31 32 33 34 |
# File 'lib/build-tool/cfg/visitor.rb', line 26 def visit_nodes(nodes) list = [] return list if nodes.nil? nodes.each do |child| break if child.nil? list << child.accept( self ) end return list end |