From: Carl Youngblood Date: 2003-11-29T11:32:10+09:00 Subject: Class-level readers and writers I've been working with the class attribute shortcuts that Hal introduced in THE RUBY WAY: class Class def cattr_reader(*syms) syms.each do |sym| class_eval <<-EOS if !defined? @@#{sym.id2name} @@#{sym.id2name} = nil end def self.~{sym.id2name} @@#{sym} end EOS end end def cattr_writer(*syms) syms.each do |sym| class_eval <<-EOS if !defined? @@#{sym.id2name} @@#{sym.id2name} = nil end def self.#{sym.id2name}=(obj) @@#{sym.id2name} = obj end EOS end end def cattr_accessor(*syms) cattr_reader(*syms) cattr_writer(*syms) end end I'm having a problem, however, in that classes that are inherited from the ones in which I declare these attrs don't seem to have them anymore. Does anyone know how I can make my declared class attributes get inherited? Thanks, Carl Youngblood