From: Nicholas Seckar Date: 2005-04-22T01:14:10+09:00 Subject: Re: accessor for Class Variable On 4/21/05, Leonardo Francalanci wrote: > I know it's a stupid question, but I can't find the answer... > > Isn't there another way to have an accessor for a class variable than a > "def"??? Something like "attr_reader"? Actually, Rails includes a mechanism to allow class attributes. I believe the usage is class Whatever @@varname = "Default Value" cattr_accessor :varname end I'm not sure if it is documented anywhere though. You can see some examples here: http://dev.rubyonrails.com/file/trunk/actionpack/lib/action_controller/base.rb