From: Thijs De vries Date: 2010-10-21T01:04:12+09:00 Subject: Setting Class Variables with Class Method Hey guys, I was wondering how to set class variables using a class method, for example: class Foo @@this_works = 'hello' @@this_does_not = self.goodbye def self.goodbye return 'goodbye' end end Is there an equivalent to initialize but for loading class variables? I was able to get something above to work by adding a method: def self.this_does_not=() @@this_does_not = var end and than calling: Foo.this_does_not = Foo.goodbye but this would force me to use public methods and in terms of organization, I like to define class methods at the top. -- Posted via http://www.ruby-forum.com/.