We're going to start our detailed exploration of program organization by looking closely at classes: what goes into them and what comes out of them.
You already know that a class definition includes zero or more methods, variables, and constants. So an example like this
class apple @@transient = 100 #class variable PERMANENT = 200 #class constant def say_something puts "Hello." end end
holds no mystery for you. And that's most (though admittedly not all) of what you need to know to write any class in Ruby. (The other part of what you need to know, and eventually will know, has to do with writing class definitions inside class definitions, and a few other things in that vein.) ...