class RuboCop::AST::IfNode

def branches

Returns:
  • (Array) - an array of branch nodes
def branches
  branches = [if_branch]
  return branches unless else_branch
  other_branches = if elsif_conditional?
                     else_branch.branches
                   else
                     [else_branch]
                   end
  branches.concat(other_branches)
end