vendor/bundle/ruby/2.6.0/gems/rubocop-ast-1.18.0/lib/rubocop/ast/node/mixin/descendence.rb
def each_node(*types, &block)
        return to_enum(__method__, *types) unless block

        yield self if types.empty? || types.include?(type)

        visit_descendants(types, &block)

        self
      end
# Calls the given block for the receiver and each descendant node in
# depth-first order.
# If no block is given, an `Enumerator` is returned.
#
# This method would be useful when you treat the receiver node as the root
# of a tree and want to iterate over all nodes in the tree.
#
# @overload each_node
#   Yield all nodes.
# @overload each_node(type)
#   Yield only nodes matching the type.
#   @param [Symbol] type a node type
# @overload each_node(type_a, type_b, ...)
#   Yield only nodes matching any of the types.
#   @param [Symbol] type_a a node type
#   @param [Symbol] type_b a node type
# @yieldparam [Node] node each node
# @return [self] if a block is given
# @return [Enumerator] if no block is given
Calls the given block for the receiver and each descendant node in
depth-first order.
If no block is given, an `Enumerator` is returned.

This method would be useful when you treat the receiver node as the root
of a tree and want to iterate over all nodes in the tree.
Calls the given block for the receiver and each descendant node in depth - first order . If no block is given an ` Enumerator ` is returned . This method would be useful when you treat the receiver node as the root of a tree and want to iterate over all nodes in the tree .
def each_node(*types, &block)
        return to_enum(__method__, *types) unless block
        yield self if types.empty? || types.include?(type)
        visit_descendants(types, &block)
        self
      end
def each_node ( * types , & block ) return to_enum ( __method__ , * types ) unless block yield self if types . empty? || types . include? ( type ) visit_descendants ( types , & block ) self end
Calls the given block for the receiver and each descendant node in
depth-first order.
Calls the given block for the receiver and each descendant node in depth - first order .
if a block is given
if a block is given
self
if no block is given
if no block is given
Enumerator
types
block
node each node
node each node
overload
each_node Yield all nodes.
each_node Yield all nodes .
overload
each_node(type) Yield only nodes matching the type. @param [Symbol] type a node type
each_node ( type ) Yield only nodes matching the type . @param [ Symbol ] type a node type
overload
each_node(type_a, type_b, ...) Yield only nodes matching any of the types. @param [Symbol] type_a a node type @param [Symbol] type_b a node type
each_node ( type_a type_b ... ) Yield only nodes matching any of the types . @param [ Symbol ] type_a a node type @param [ Symbol ] type_b a node type