From: Robert Dober Date: 2007-07-27T19:43:56+09:00 Subject: Re: n00b if condition quest On 7/27/07, dblack@rubypal.com wrote: > Hi -- > > On Fri, 27 Jul 2007, Brett Boge wrote: > > > I'm sure theres a way, so how does one do: > > > > if (a = b or a = c or a = d or a = f) > > > > in a shorter, easier to view > > > > if (a = (b c d or f)) kind of way? > > You mean == rather than = , but in any case, try this: > > if [b,c,d,f].include?(a) You are right for sure that OP meant ==, but let us answer the original question too ;) a = [b,c,d,e,f].compact.first Robert -- [...] as simple as possible, but no simpler. -- Attributed to Albert Einstein