From: Ian Macdonald Date: 2003-07-01T19:16:52+09:00 Subject: Re: anonymous classes On Tue 01 Jul 2003 at 19:04:23 +0900, Brian Candler wrote: > On Tue, Jul 01, 2003 at 08:50:31AM +0900, Ian Macdonald wrote: > > Hi, > > > > Could someone please explain to me the concept of an anonymous class? > > > > I'm talking about this construct: > > > > class << Foo > > ... > > end > > > > I'm having a hard time understanding the books and figuring out when I > > might actually want/need to use this. > > What you've written is called a "singleton class". I wrote this a while: > > http://www.rubygarden.org/ruby?SingletonTutorial > > It might be helpful and includes a couple of links to more detailled > information. Thanks. This is an excellent resource and makes things a lot clearer. Ian -- Ian Macdonald | Yes, we will be going to OSI, Mars, and System Administrator | Pluto, but not necessarily in that order. ian@caliban.org | -- Jeffrey Honig http://www.caliban.org | |