def each_child_node(*types)
      return to_enum(__method__, *types) unless block_given?

      types.flatten!

      children.each do |child|
        next unless child.is_a?(Node)
        yield child if types.empty? || types.include?(child.type)
      end

      self
    end
def each_child_node(*types)
      return to_enum(__method__, *types) unless block_given?

      types.flatten!

      children.each do |child|
        next unless child.is_a?(Node)
        yield child if types.empty? || types.include?(child.type)
      end

      self
    end
Calls the given block for each child node.
 If no block is given, an `Enumerator` is returned.

 Note that this is different from `node.children.each { |child| ... }` which yields all
 children including non-node element.

 @overload each_child_node
   Yield all nodes.
 @overload each_child_node(type)
   Yield only nodes matching the type.
   @param [Symbol] type a node type
 @overload each_child_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
 @overload each_child_node(types)
   Yield only nodes matching any of types in the array.
   @param [Array<Symbol>] types an array containing node types
 @yieldparam [Node] node each child node
 @return [self] if a block is given
 @return [Enumerator] if no block is given