Toby Clemson wrote:
> Is there a way to define a class level variable that descends down the
> inheritance tree unless it is overridden in the same way as this is
> possible for methods?

Yes, using a hash that inherits values:

http://redshift.sourceforge.net/superhash/
http://redshift.sourceforge.net/superhash/lib/superhash.html

Sorry for the crappy docs. It's an old project, but I use it frequently.

Here's an example

require 'superhash'

class A
   class_superhash :options

   options[:foo] = "A foo"
   options[:bar] = "A bar"

   def options; self.class.options; end
end

class B < A
   options[:foo] = "B foo"
end

p A.options
p B.options.to_hash
p B.new.options.to_hash

__END__

output:

{:foo=>"A foo", :bar=>"A bar"}
{:foo=>"B foo", :bar=>"A bar"}
{:foo=>"B foo", :bar=>"A bar"}

-- 
       vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407