On Nov 13, 2007 3:35 PM, Kamil <kamil.kukura / gmail.com> 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