Class: Spoom::FileTree::Visitor

Inherits:
Object
  • Object
show all
Extended by:
T::Helpers, T::Sig
Defined in:
lib/spoom/file_tree.rb

Overview

An abstract visitor for FileTree

Direct Known Subclasses

CollectNodes, CollectStrictnesses, Printer

Instance Method Summary collapse

Instance Method Details

#visit_node(node) ⇒ Object



113
114
115
# File 'lib/spoom/file_tree.rb', line 113

def visit_node(node)
  visit_nodes(node.children.values)
end

#visit_nodes(nodes) ⇒ Object



118
119
120
# File 'lib/spoom/file_tree.rb', line 118

def visit_nodes(nodes)
  nodes.each { |node| visit_node(node) }
end

#visit_tree(tree) ⇒ Object



108
109
110
# File 'lib/spoom/file_tree.rb', line 108

def visit_tree(tree)
  visit_nodes(tree.roots)
end