If:
if true this.someMethod() end
If / else:
if i == 0 this.methodA() else this.methodB() end
Else if
if i == 0 this.methodA() else if i == 1 this.methodB() else this.methodC() end
Single-line statements can be shortened to:
if true : this.someMethod()
if i == 0 : this.methodA() else : this.methodB()
Or mixed:
if i == 0 : this.methodA() else if i == 1 : this.methodB() else this.methodC1() this.methodC2() end
if !true : return
if x > 2 && x < 10 : this.doSomething()
if x == 2 || x == 4 : this.doSomething()
switch i case 0 this.methodA() end case 1 this.methodB() end default this.methodC() end end
Or short:
switch i case 0 : this.methodA() case 1 : this.methodB() default : this.methodC() end