seejohnrun/ice_cube — pull request #203 by igraves (2013-11-23 21:59:30+00:00)
Title: Use Enumerator to model occurrences in Schedule

I've been encountering some use-cases where I need to deal with infinite lists of recurring events in a manageable way. Using an Enumerator to do this in a less-eager fashion seems like a good way to approach the problem. I replaced find_occurrences() in Schedule with enumerate_occurrences() and rewrote all the calls to find_occurrences() accordingly. Additionally, I added two methods that emit the underlying enumerator so one can use an enumerator to manage a (potentially infinite) list of occurrences.