From: "Damián M. González" Date: 2012-09-16T06:30:17+09:00 Subject: Re: Class variables or class singleton variables? Jan E. wrote in post #1076186: > Exactly. And the singleton class can also have its own methods and > constants. In fact, the only relation to the original class is that the > instance methods of the singleton class are the singleton methods of the > original class (and vice versa). Apart from that it's a completely > separate class. Well this is amazing, I've tried to understand what you say, you mean this?: class Foo; end class << Foo attr_accessor :x @x = 1 def lalala "lalala #{@x}" end end class Foo @x = 2 def self.lelele "lelele #{@x}" end end irb(main):018:0* Foo.lalala => "lalala 2" irb(main):019:0> Foo.lelele => "lelele 2" irb(main):020:0> Foo.singleton_class.instance_variable_get :@x => 1 -- Posted via http://www.ruby-forum.com/.