From: James Britt Date: 2006-04-11T00:08:44+09:00 Subject: Re: Adding in class attribute with a Module dblack@wobblini.net wrote: > Hi -- > > On Mon, 10 Apr 2006, Austin Ziegler wrote: > >> On 4/10/06, kris wrote: >> >>> PS. I didnt write cattr_accessor. I'm using Rails but I dont think it is >>> opart of that? >> >> >> cattr_accessor is a Railsism. It is not part of standard Ruby. >> >> I'm undecided whether it should be or not, but it is potentially very >> useful. > > > If it ever is, I think it needs a new name. It's a wrapper for class > variables, but class variables, in my view, are not really suitable > for implementing "attributes", because they are not uniquely > associated with one object. But isn't a class an instance of Class? Foo = Class.new # instance object of class Class f = Foo.new # instance object of class Foo > I don't like the sprawl of the concept of > an "attribute" of a class-hierarchy-plus-instances-of-those-classes. The 'attribute' concept is messy as it is, but this class use seems to be a natural extension of the 'methods that get/set an object variable of the same name' idea. -- James Britt �Design depends largely on constraints.� � Charles Eames