Class: TreeStand::Visitors::TreeWalker
- Inherits:
-
TreeStand::Visitor
- Object
- TreeStand::Visitor
- TreeStand::Visitors::TreeWalker
- Extended by:
- T::Sig
- Defined in:
- lib/tree_stand/visitors/tree_walker.rb
Overview
Walks the tree depth-first and yields each node to the provided block.
Instance Method Summary collapse
- #initialize(node, &block) ⇒ void constructor
- #on(node) ⇒ void
Methods inherited from TreeStand::Visitor
Constructor Details
#initialize(node, &block) ⇒ void
28 29 30 31 |
# File 'lib/tree_stand/visitors/tree_walker.rb', line 28 def initialize(node, &block) super(node) @block = block end |
Instance Method Details
#on(node) ⇒ void
This method returns an undefined value.
34 |
# File 'lib/tree_stand/visitors/tree_walker.rb', line 34 def on(node) = @block.call(node) |