case
ruby では switch の代わりにcaseってのをつかう。
>|ruby|
case value
when "test1"
print 1
when "test2"
print 2
else
print "others"
end
||<
履歴
- 第 1 版おぎやす2009-11-16 18:20:23
ruby では switch の代わりにcaseってのをつかう。
>|ruby|
case value
when "test1"
print 1
when "test2"
print 2
else
print "others"
end
||<