From: Hal Fulton Date: 2004-03-20T06:40:26+09:00 Subject: Re: Thinking about a date-matching algorithm... Sam Roberts wrote: > Wrote Josh_Neland@Dell.com, on Fri, Mar 19, 2004 at 12:52:14AM +0900: > >>Why not just provide a each_before(stop_time) {block} method? > > > When I want to: > > - know if a time exists satisfying a condition > > with each(), I can call Enumerabe.detect { cond...} > > with each_before(stop_time) I have to implement Enumeralbe.detect myself > > - get all times within a period > > with each(), I can call Enumerable.find_all { cond.. } > > with each_before(stop_time) I have to implement Enumerable.find_all > myself > > ... > > > You can build any kind of each_x_y() you want, but you don't get the > utilities from the Enumerable mixin when you do so. Hmm. Maybe you could implement some sort of discrete range or list of days, and then run against that. Hal