조건문
조건문
if/else/elsif/end
if/else/elsif/endif x < y # Assumes x and y are defined
puts "x is less than y!"
elsif x > y
puts "x is greater than y!"
else
puts "x equals y!"
endexpression if booleanunless/else/end
unless/else/endunless hungry
# Write some
else
# Have some noms
endexpression unless booleancase/when/else/end
case/when/else/endternary conditional expression
Comparators
relational operator
logical operator
Last updated