From: "Jan E." Date: 2012-06-10T09:02:03+09:00 Subject: Re: Class variables and self Henry Maddocks wrote in post #1063893: > On 10/06/2012, at 9:20 AM, Mike Glaz wrote: > >> so is self.total_count equal to self.class.total_count? > > It depends where they are called. You need to know what self is at the > point where the call is made. Going back to your sample code... > [...] > So in answer to your question, Yes they are the same object. No, they are never the same object. self.class in the context of Car is not Car but Class, because the class of a class is Class. The only context where self and self.class are the same is the context of Class, because Class is an instance of itself. -- Posted via http://www.ruby-forum.com/.