From: Shadowfirebird Date: 2011-03-08T06:35:07+09:00 Subject: Re: basic programming question, help please If you want to say "Square.count" then you need a class method and that's how you define one. I don't know if there is an especial advantage in doing it this way, other than it makes more sense when you read the code. (Anyone?) You could equally have written: class Square def initialize if defined?(@@number_of_squares) @@number_of_squares = @@number_of_squares + 1 else @@number_of_squares = 1 end end def count @@number_of_squares end end a = Square.new b = Square.new puts b.count