Method: RuboCop::AST::ForNode#collection

Defined in:
lib/rubocop/ast/node/for_node.rb

#collectionNode

Returns the collection the ‘for` loop is iterating over.

Returns:

  • (Node)

    The collection the ‘for` loop is iterating over



41
42
43
# File 'lib/rubocop/ast/node/for_node.rb', line 41

def collection
  node_parts[1]
end