From: dblack@... Date: 2007-08-09T20:23:22+09:00 Subject: Re: case statement Hi -- On Thu, 9 Aug 2007, Shai Rosenfeld wrote: >> a = [1,2,3,4] >> result = case >> when a.include?(1): 'this is what i want' >> when a.include?(11): 'not result' >> when a.include?(15): 'no good' >> end > > > ahhhhhhhhhhhhhhhh > perfect. I'm curious about the fall-through case. If the array does not include 1, 11, or 15, then result will be nil, which I assume is equivalent to a "no good" result. That makes me wonder whether a simple include? would work equally well. Or is there more to the various error conditions? David -- * Books: RAILS ROUTING (new! http://www.awprofessional.com/title/0321509242) RUBY FOR RAILS (http://www.manning.com/black) * Ruby/Rails training & consulting: Ruby Power and Light, LLC (http://www.rubypal.com)