"Paul Brannan" <paul / atdesk.com> wrote in
....

>
http://rm-f.net/~cout/ruby/treasures/RubyTreasures-0.1/lib/hacks/accessors.rb.ht
ml
>
...
Hm there are a couple of typos in your solution (and Dave's wombat is
a completely different animal - a.k.a. a ``per class instance'' attribute) -

------
--- accessors.rb.new    Wed Jan 16 18:11:59 2002
+++ accessors.rb        Wed Jan 16 18:11:49 2002
@@ -16,9 +16,8 @@
       self.class_eval %{
         ##
         # @ignore
-        @@#{symbol} = nil unless defined? @@#{symbol}
         def self.#{symbol}
-          @@#{symbol}
+          @@symbol
         end
       %}
     end
@@ -33,7 +32,7 @@
         ##
         # @ignore
         def self.#{symbol}(x)
-          @@#{symbol} = x
+          @@symbol = x
         end
       %}
     end
------

/Christoph