class RuboCop::AST::NodePattern
def self.descend(element, &block)
Yields its argument and any descendants, depth-first.
def self.descend(element, &block) return to_enum(__method__, element) unless block yield element if element.is_a?(::RuboCop::AST::Node) element.children.each do |child| descend(child, &block) end end nil end