Hi --

On Fri, 9 May 2003, Jim Freeze wrote:

> 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?

See Mauricio's reply -- also, there's discussion of this at:
<http://www.rubygarden.org/ruby?ClassMethodsTutorial>.


David

-- 
David Alan Black
home: dblack / superlink.net
work: blackdav / shu.edu
Web:  http://pirate.shu.edu/~blackdav