開発メモ

開発用のメモです。

Ruby 条件( if / unless )

# type of not define
inumber = 5;
if inumber == 5 then
    puts "inumber == 5  \n";
end

if inumber <= 5 then
    puts "inumber <= 5  \n";
end

if inumber >= 5 then
    puts "inumber >= 5  \n";
end

unless inumber < 5 then
    puts "! inumber < 5  \n";
end

unless inumber > 5 then
    puts "! inumber > 5  \n";
end

unless inumber != 5 then
    puts "! inumber != 5  \n";
end
Twitter: @asahina_alice