Tuesday, February 3, 2009

Ruby Case When

   1. case foo
2. when 1 then puts "Foo is equal to 1"
3. when 2..9 then puts "Foo is between 2 and 9"
4. else puts "Foo is something else"
5. end

No comments: