From: Matthew Kerwin Date: 2012-09-14T06:02:42+09:00 Subject: Re: ruby Range to array that acts like time objects? On 13 September 2012 23:43, Robert Klemme wrote: > > Your #succ method does not overflow. I would make the class immutable > since that has some advantages. Actually my #succ did overflow, because the constructor used the #minutes= method which, with the exception of a modulus error pointed out earlier, overflowed into @hours. I agree, though, that making it immutable would be easier. However this is all moot since it turns out it's a question of overlapping time ranges, which can be solved in more interesting ways. Jermaine: have you considered other options, such as decreasing the granularity (e.g. using 10- or 15-minute blocks instead of 1-minute)? Or combining the available and unavailable ranges without ever discretising them? My intuitive approach would be the latter. If I wasn't about to get my kids up and ready for school I'd probably hash out another almost-correct algorithmic outline right now. Cheers