Module: Hashira::Analysis::NodeWalk
- Defined in:
- lib/hashira/analysis/node_walk.rb
Class Method Summary collapse
Class Method Details
.collect(node) ⇒ Object
13 14 15 16 17 |
# File 'lib/hashira/analysis/node_walk.rb', line 13 def collect(node) found = [] each_node(node) { found << it } found end |
.each_node(node) {|node| ... } ⇒ Object
8 9 10 11 |
# File 'lib/hashira/analysis/node_walk.rb', line 8 def each_node(node, &) yield(node) node.compact_child_nodes.each { each_node(it, &) } end |