Skip to content

Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →

instance method

Ruby::Prism::Node#breadth_first_search_all

breadth_first_search_all() { |node| ... }

Returns all of the nodes that match the given block when visited in a breadth-first search. This is useful for finding all nodes that match a particular condition.

Example
 node.breadth_first_search_all { |node| node.is_a?(Ruby::Prism::CallNode) }

: () { (node) -> bool } -> Array[node]