Stenway Developer Network

case Keyword

Case

switch i
  case 0
    methodA()
  end
  case 1
    methodB()
  end
  default
    methodC()
  end
end

Or short:

switch i
  case 0 : methodA()
  case 1 : methodB()
  default : methodC()
end