Joel VanderWerf
7/12/2005 5:01:00 PM
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.