class RuboCop::AST::ForNode
to all ‘for` nodes within RuboCop.
node when the builder constructs the AST, making its methods available
A node extension for `for` nodes. This will be used in place of a plain
def body
-
(Node, nil)
- The body of the `for` loop.
def body node_parts[2] end
def collection
-
(Node)
- The collection the `for` loop is iterating over
def collection node_parts[1] end
def do?
-
(Boolean)
- whether the `for` node has a `do` keyword
def do? loc.begin&.is?('do') end
def keyword
-
(String)
- the keyword of the `until` statement
def keyword 'for' end
def variable
-
(Node)
- The iteration variable of the `for` loop
def variable node_parts[0] end
def void_context?
-
(true)
- whether the `for` node body is a void context
def void_context? true end