Snippets: Ruby Switch Statements
June 20, 2007 @ 10:47 AM | posted by carmelyne
(last updated: 06.24.07)1 2 3 4 5 |
case foo when 1 then puts "Foo is equal to 1" when 2..9 then puts "Foo is between 2 and 9" when 10 then puts "Foo is equal to 10" end |
Source: http://railsforum.com/viewtopic.php?pid=27834#p27834
[ Last updated: June 24, 2007 @ 11:06 PM ]




Sorry, comments are closed for this article.