class RuboCop::AST::WhenNode

def branch_index

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