class RuboCop::AST::Node
def each_child_node(*types)
-
(Enumerator)
- if no block is given -
(self)
- if a block is given
Other tags:
- Yieldparam: node - each child node
Parameters:
-
type_b
(Symbol
) -- a node type -
type_a
(Symbol
) -- a node type -
type
(Symbol
) -- a node type
Overloads:
-
each_child_node(type_a, type_b, ...)
-
each_child_node(type)
-
each_child_node
def each_child_node(*types) return to_enum(__method__, *types) unless block_given? children.each do |child| next unless child.is_a?(Node) yield child if types.empty? || types.include?(child.type) end self end