From: Jim Freeze Date: 2003-05-09T13:13:51+09:00 Subject: Re: Can a global be a constant? On Friday, 9 May 2003 at 8:57:15 +0900, dblack@superlink.net wrote: > Hi -- > > You can use instance variables (of the object State) instead of class > variables, and then State becomes: > > class State > class << self > attr_accessor :debug, :verbose > end > end So, fundamentally, is the code in both class C and D below doing the same thing? class C class << self def set(x); @x = x; end def get; puts @x; end end end class D def self.set; @x = 5; end def self.get; puts @x; end end If these class methods have instance variables for the singleton object, are class methods not just really instance methods of the singleton object? -- Jim Freeze ---------- "I had to censor everything my sons watched ... even on the Mary Tyler Moore show I heard the word 'damn'!" -- Mary Lou Bax