class RuboCop::AST::Node

def each_ancestor(*types, &block)

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

Other tags:
    Yieldparam: node - each ancestor node

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

Overloads:
  • each_ancestor(type_a, type_b, ...)
  • each_ancestor(type)
  • each_ancestor
def each_ancestor(*types, &block)
  return to_enum(__method__, *types) unless block_given?
  visit_ancestors(types, &block)
  self
end