From: Henry Maddocks Date: 2012-06-10T08:44:27+09:00 Subject: Re: Class variables and self 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... class Car # At the point self == Car so self.total_count is the same as Car.total_count. # Note that this a method declaration, you are defining a class method. def self.total_count @total_count || 0 end [snip] def initialize(make) [snip] # At this point, inside a method declaration self == an instance of Car NOT Car. # So self.class is Car therefore this statement is the same as Car.total_count. self.class.total_count += 1 So in answer to your question, Yes they are the same object. Understanding when self changes and to what is a pretty important concept in Ruby. Henry