Class: Spoom::FileTree::CollectNodes
- Defined in:
- lib/spoom/file_tree.rb
Overview
A visitor that collects all the nodes in a tree
Instance Attribute Summary collapse
- #nodes ⇒ Object readonly
Instance Method Summary collapse
-
#initialize ⇒ CollectNodes
constructor
A new instance of CollectNodes.
- #visit_node(node) ⇒ Object
Methods inherited from Visitor
Constructor Details
#initialize ⇒ CollectNodes
Returns a new instance of CollectNodes.
121 122 123 124 |
# File 'lib/spoom/file_tree.rb', line 121 def initialize super() @nodes = [] #: Array[FileTree::Node] end |
Instance Attribute Details
#nodes ⇒ Object (readonly)
118 119 120 |
# File 'lib/spoom/file_tree.rb', line 118 def nodes @nodes end |
Instance Method Details
#visit_node(node) ⇒ Object
128 129 130 131 |
# File 'lib/spoom/file_tree.rb', line 128 def visit_node(node) @nodes << node super end |