Rubyで条件分岐
if 条件 then 実行したい処理 end if 条件 then 処理1 else 処理2 end
unless 条件 then 条件が偽の場合に実行したい処理 end
実行したい処理 if 条件 #または begin 実行したい処理 end if 条件
実行したい処理 unless 条件 #または begin 実行したい処理 end unless 条件
#case文は下記 #それぞれ該当した場合のみ1回実行されるます case 比較したい式 when 値1 then 処理1 when 値2 then 処理2 when 値3 then 処理3 else 処理4 end