From: Ron Jeffries Date: 2002-02-26T05:04:28+09:00 Subject: Re: Style Question On Mon, 25 Feb 2002 18:38:17 GMT, Dave Thomas wrote: >Ron Jeffries writes: > >> I don't understand the notation above with class << etc. What's up with >> that? How is it different from >> >> class Set >> protected :new >> end > >'new' isn't an instance method of class Set, so the line above >wouldn't work. Instead, new is defined in Set's metaclass. You can >pop into the metaclass using the singleton class thingy. > > class < .. > end > >means start defining stuff in the class specific to object 'x'. Inside >a normal class definition, 'self' is the class itself, so class <gets us into the meta class. Hence > > class < protected :new > end Check. Weird but I get it. Thanks! Ronald E Jeffries http://www.XProgramming.com http://www.objectmentor.com I'm giving the best advice I have. You get to decide whether it's true for you.