Method: ActiveComponent::Base#each_leaf
- Defined in:
- lib/active_component/base.rb
#each_leaf {|node| ... } ⇒ Object
Yields every leaf node of the (sub)tree rooted at the receiver node to the specified block.
May yield this node as well if this is a leaf node. Leaf traversal is depth-first and left-to-right.
502 503 504 |
# File 'lib/active_component/base.rb', line 502 def each_leaf &block self.each { |node| yield(node) if node.isLeaf? } end |