class RuboCop::AST::Node

def each_node(*types, &block)

Returns:
  • (Enumerator) - if no block is given
  • (self) - if a block is given

Other tags:
    Yieldparam: node - each node

Parameters:
  • type_b (Symbol) -- a node type
  • type_a (Symbol) -- a node type
  • type (Symbol) -- a node type

Overloads:
  • each_node(type_a, type_b, ...)
  • each_node(type)
  • each_node
def each_node(*types, &block)
  return to_enum(__method__, *types) unless block_given?
  yield self if types.empty? || types.include?(type)
  visit_descendants(types, &block)
  self
end