From: "Jan E." Date: 2012-06-10T08:18:19+09:00 Subject: Re: Class variables and self Mike Glaz wrote in post #1063878: > so is self.total_count equal to self.class.total_count? No, of course not. self refers to the particular instance of Car, whereas self.class refers to the *class* of this instance, i. e. Car itself. Those are two completely different objects. Since the instances of Car don't even have a total_count method, calling self.total_count will throw an exception (try it yourself). It's important to distinguish between the methods of the class and the methods of the instances. The Car class has three new methods: total_count, total_count= and add_make. The instances of Car also have three new methods: make_mates, initialize and make (the latter is created by attr_reader). Check it for yourself: puts Car.methods(false) my_ferrari = Car.new('Ferrari') puts my_ferrari.methods(false) The "false" argument suppresses the inherited methods. -- Posted via http://www.ruby-forum.com/.