2008年5月24日 星期六

case

ex:
case  name
when "peter"
puts "peter"
when "andy"
puts  "andy"
else
puts  "others"
end

how it works
translate to 
if "peter" === name

note: the === method can be customarily defined

沒有留言: