From: Sharon Phillips Date: 2007-07-04T19:36:49+09:00 Subject: Re: Ruby case statement > case type > when 1 > # do stuff for type 1 > when 1,2 > # do stuff for both type 1 and 2 > end > > If it isn't valid, what is the easiest way to obtain this > functionality > i=1 case i when 1: puts "1" when 1,2: puts "1 or 2" when 3: puts "3" else puts "other" end > 1 so it looks like the second one gets skipped. The best i can come up with (but I'm pretty sure someone else will come up with a much better alternative) is i=1 case i when 1,2 puts "1 or 2" puts "1" if i==1 when 3 puts "3" else puts "other" end > 1 or 2 > 1 Cheers, Dave