From: "Iñaki Baz Castillo" Date: 2008-08-22T02:51:09+09:00 Subject: Re: "num in [1,2,3,4]" in a cool way? El Jueves, 21 de Agosto de 2008, Gregory Brown escribió: > On Wed, Aug 20, 2008 at 5:32 PM, Iñaki Baz Castillo wrote: > > Hi, AFAIK in Ruby the only (or the "coolest") way to do something as: > > > > if num in [1,2,3,4] > > > > is by doing: > > > > if [1,2,3,4].index(num) > > > > Is it? any other "cooler" way? Thanks. > > num.between?(1,4) Great, I didn't know! :) But in my case I'm using custom objects instead of Fixnum or String. Thanks a lot. -- Iñaki Baz Castillo