条件语句

if

if a>b then
    p 'a大于b'
elsif a<b then
    p 'a小于b'
else
    p 'a等于b'
end
p 'a比b大' if a> b

unless 当条件不成立时

unless a>b then
    p 'a小于b'
end

case ... when

case a
when '1' then
    p '1'
when '2' then
    p '2'
else
    p 'other'
end