From: "David A. Black" Date: 2008-09-30T20:05:08+09:00 Subject: Re: extend keyword in class definition Hi -- On Tue, 30 Sep 2008, ruud grosmann wrote: > OK. I think now I get what you mean. > > To make sure I understood it right: > my mistake was that there are both singleton methods on classes and > singleton methods on instances of a class. Essentially the same, > because classes are objects too. In this case, we're talking about > singleton methods on the class WriterDecorator. This is done because > the Forwardable method 'def_delegators' is used by the class object > only, not by it's instances. Which would have been the case if > Forwardable was mixed in. > Please correct me if I'm wrong. The only thing I'd add is that it's not really accurate to describe methods defined in a module as "singleton methods" of an object that extends itself with the module. A singleton method is really a method defined in the object's singleton class itself. David -- Rails training from David A. Black and Ruby Power and Light: Intro to Ruby on Rails January 12-15 Fort Lauderdale, FL Advancing with Rails January 19-22 Fort Lauderdale, FL * * Co-taught with Patrick Ewing! See http://www.rubypal.com for details and updates!