From: Gavin Kistner Date: 2004-11-04T00:21:05+09:00 Subject: Re: class variables from modules On Nov 3, 2004, at 7:14 AM, Florian Weber wrote: > how can i make that the example below returns 'Hello, my name is test'? One way: module ClassMethods attr_accessor :bar end class Foo extend ClassMethods self.bar = "test" def hi puts "Hello, my bar is #{self.class.bar}" end end Foo.new.hi -- "Despite the surge of power you feel upon learning Ruby, resist the urge to trip others or slap them in the bald head. DO NOT LORD YOUR RUBYNESS OVER OTHERS!" - Why the Lucky Stiff