From: Shai Rosenfeld Date: 2007-08-08T23:54:42+09:00 Subject: Re: case statement Alex Young wrote: > Shai Rosenfeld wrote: >> drift) i'm not sure how to do it: >> >> case [3, 45, 6, 'abc'].inlcude? >> when 1: 'no good' >> when 3: 'good!' >> when 'lolo': 'no good' >> end > I'm not sure why you're using case here. I'd do it like this: > > [3, 45, 6, 'abc'].include?(var) ? "good" : "no good" ...went for this in the end. i suppose the case statement w/ array include opt didn't really fit the needs, all in all. thanks all for your answers though. David, what is this all? method? is it a Array#method ? i didn't find it in the docs..? [*a].all? {|e| include?(a) } and not [*b].any? {|e| include?(e) } -- Posted via http://www.ruby-forum.com/.