From: Edgardo Hames Date: 2004-10-06T03:20:12+09:00 Subject: Re: A ruby course On Wed, 6 Oct 2004 02:24:12 +0900, Brian Schr�der wrote: > > Anybody has an idea for an exercise on extending existing classes. So > far the only thing I have come up with is: > Taken from the Design Patterns book, Decorator pattern: "Attach additional responsibilities to an object dynamically. Decorators provide a flexible alternative to subclassing for extending functionality." 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 My 2 cents. Ed -- " Don't relax! It's only your tension that's holding you together."