From: Sean O'Halpin Date: 2007-11-17T11:51:17+09:00 Subject: Re: Handy method Object#in? On Nov 13, 2007 3:35 PM, Kamil wrote: > I wish there would be this simple method in the core: > > class Object > def in?(an_array) > an_array.include?(self) > end > end > > Having that it's nice to write: > > a = %w(hello world out there) > puts 'world'.in?(a) > > And it works with Interval instance too. > It is nice, but I would advise you to profile code that uses it and ask yourself if it is worth the cost. Regards, Sean