From: James Edward Gray II Date: 2004-10-06T03:40:03+09:00 Subject: Re: A ruby course On Oct 5, 2004, at 1:20 PM, Edgardo Hames wrote: > You could extend Integer with a fibonacci method, so that you can > write something like: > > puts 0.fibonacci > 0 > puts 1.fibonacci > 1 > puts 5.fibonacci > 5 There was an excellent example along these lines in the RubyConf '04 blogs. According to Francis Hwang's blog: "Also, Rich [Kilmer] described a cool little hack: Adding time-unit methods to Fixnum so you can write code like time_to_restart = 5.hours + 15.minutes. Dude, I'm totally stealing that." I have to agree with the entry, it's a killer trick. James Edward Gray II