From: Khat Harr Date: 2011-12-21T03:26:02+09:00 Subject: Re: Accessing class instance variables from an instance? An instance variable is prefaced by @, where a class variable is prefaced by @@. Here's a small example: class Thingy @@thingies = 0 def initialize(name) @my_name = name @@thingies += 1 puts "A new thingy is here!" end def whatsMyName puts "This thingy is named '#{@my_name}'." end def howMany? puts "So far you have created #{@@thingies} thingies." end end The @@thingies class variable is shared by all instances of the class. Changing that variable in any one of the classes will change it for all of them. Is this what you were looking for? -- Posted via http://www.ruby-forum.com/.