From: Joel VanderWerf Date: 2005-07-13T02:01:09+09:00 Subject: Re: adding attributes (attr_*-style) to single objects Joel VanderWerf wrote: > David A. Black wrote: > ... > >> class C >> add_attr_accessor(:x) > > attr_accessor(:x) > >> end > > > The method names are too close. I would have guessed these did the same > thing. > > I like the idea, but why not just make #attr_accessor public, so you can > write: > > self.attr_accessor :x > > and make it clear that you are not adding an instance method. Duh. That suggestion made no sense. Maybe something like my_attr_accessor :x to add an accessor to the current self, rather than to instances of the current self.