Hal E. Fulton
11/29/2003 4:45:00 AM
David A. Black wrote:
> (Just as a footnote, you can also use "normal" accessor shortcuts at
> the class object level:
>
> class A
> class << self
> attr_accessor :x
> end
> end
>
> A.x = 1 # and so on
>
> which is implemented with instance variables rather than class
> variables, if for any reason that suits your purposes better.)
For the record, this is a cool trick. The reason it isn't in
TRW is simply that I didn't think of it.
The effect is subtly different, but it's a good idiom.
Thanks, David...
Hal