case文 cond = 'hoge' case cond when /hoge/ then puts 'is hoge' when /fuga/ then puts 'is fuga' else puts 'unknown' end Ruby | case文を使った条件分岐