From: Rick DeNatale Date: 2009-07-17T03:59:37+09:00 Subject: Re: case statement puzzle On Thu, Jul 16, 2009 at 12:55 PM, James Coglan wrote: > What about: > > x='1' > case > when x =='0' >  puts '0' > when '1'..'5' >  puts '1' > end Almost, that second when will ALWAYS match. Better to use the form of case which takes a value %w{0 1 2}.each do |x| case x when '0' puts "it's like nothing, man!" when '1'..'5' puts "it's in there" end end it's like nothing, man! it's in there it's in there -- Rick DeNatale Blog: http://talklikeaduck.denhaven2.com/ Twitter: http://twitter.com/RickDeNatale WWR: http://www.workingwithrails.com/person/9021-rick-denatale LinkedIn: http://www.linkedin.com/in/rickdenatale