class RuboCop::AST::InPatternNode

to all ‘in` nodes within RuboCop.
node when the builder constructs the AST, making its methods available
A node extension for `in` nodes. This will be used in place of a plain

def body

Returns:
  • (Node, nil) - the body of the `in` node
def body
  node_parts[-1]
end

def branch_index

Returns:
  • (Integer) - the index of the `in` branch
def branch_index
  parent.in_pattern_branches.index(self)
end

def pattern

Returns:
  • (Node) - a pattern node
def pattern
  node_parts.first
end

def then?

Returns:
  • (Boolean) - whether the `in` node has a `then` keyword
def then?
  loc_is?(:begin, 'then')
end