From: Philip Gatt Date: 2007-10-24T17:04:18+09:00 Subject: Re: [QUIZ] Time Window (#144) That's the same thought that I had. Assuming that any? didn't exist, I am still fearful of adding methods to core classes. I think core classes should only be modified in special cases, like building a framework. How do the rest of us feel about this? - Philip On Oct 24, 2007, at 12:16 AM, Jesús Gabriel y Galán wrote: > On 10/24/07, James Koppel wrote: >> I then wrote the simple Array#some method that returns true if >> the given >> predicate returns true for at least one of its elements, which I >> used to write >> TimeWindow#incude?. > >> class Array >> def some >> each {|el| return true if yield el} >> false >> end >> end > > Isn't this the same as Enumerable#any? > > Jesus. >