class RuboCop::AST::CaseMatchNode

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

def each_in_pattern(&block)

Deprecated:
  • Use `in_pattern_branches.each`
def each_in_pattern(&block)
  return in_pattern_branches.to_enum(__method__) unless block_given?
  in_pattern_branches.each(&block)
  self
end

def else?

Returns:
  • (Boolean) - whether the `case` statement has an `else` branch
def else?
  !loc.else.nil?
end

def else_branch

Returns:
  • (nil) - if the case statement does not have an else branch.
  • (Node) - the else branch node of the `case` statement
def else_branch
  node_parts[-1]
end

def in_pattern_branches

Returns:
  • (Array) - an array of `in_pattern` nodes
def in_pattern_branches
  node_parts[1...-1]
end

def keyword

Returns:
  • (String) - the keyword of the `case` statement
def keyword
  'case'
end