A few other interesting things are going on in this program. Right at the top of the Thing class you will see this:
@@num_things = 0
@ characters at the start of this variable name,
@@num_things, define this to be a class variable. The variables we’ve used inside classes up to now have been instance variables, preceded by a single
@name. Whereas each new object (or instance) of a class assigns its own values to its own instance variables, all objects derived from a specific class share the same class variables. I have assigned 0 to the
@@num_things variable to ensure that it has a meaningful value at the outset.
@@num_things class variable is used to keep a running total of the number of Thing objects in ...