From: Ken Kunz Date: 2006-10-12T06:40:17+09:00 Subject: Re: case ... when and arrays (or what was why_ showing us at railsconf europe) To determine if some object is included in a collection: collection.include? obj e.g.: %w(foo bar baz).include? "foo" => true also, have a look at Enumerable#grep -- it uses === for comparison (just like case/when): a = [ "bar", 3, 7.5, "baz" ] a.grep String => ["bar", "baz"] a.grep Numeric => [3, 7.5] a.grep /^b/ => ["bar", "baz"] a.grep "bar" => ["bar"] a.grep 1..5 => 3 -Ken J2M wrote: > I like that so much I want more... > > Can you do something equivalent with an if and *bang?