From: ara.t.howard@... Date: 2006-12-02T05:48:32+09:00 Subject: Re: Timers, scheduling and Ruby On Sat, 2 Dec 2006, Lipper, Matthew wrote: >> inclusive_endpoint = Time.now + 6.days > ^^^^^^^^ > is there already a library/utility for the above somewhere? written many times, but here's mine: class Numeric def microseconds() Float(self * (10 ** -6)) end def milliseconds() Float(self * (10 ** -3)) end def seconds() self end def minutes() 60 * seconds end def hours() 60 * minutes end def days() 24 * hours end def weeks() 7 * days end def months() 30 * days end def years() 365 * days end def decades() 10 * years end %w[ microseconds milliseconds seconds minutes hours days weeks months years decades ].each{|m| alias_method m.chop, m} end you don't have to write that part ;-) >> make sense? > > think so; will try to add this weekend. If I have questions may I contact > you offline? (I'm subscribed to CLR w/my work address -- cc'd address above > is perfect!) absolutely. > np, thanks for the kind words! ...anyway, Martin Fowler did all the hard i dunno about that - having transcribed quite a few books/articles into code myself - it's hard wrapping your head around someone else's ideas/code. cheers. -a -- if you want others to be happy, practice compassion. if you want to be happy, practice compassion. -- the dalai lama