
Working With Unix Processes

Self and scope are similar in that they both change over the course of a program, and in that you can deduce what’s going on with them by reading the program as well as running it. But scope and self aren’t the same thing.
Joe Leo • The Well-Grounded Rubyist
Again, the logic required to figure out what object owns a given instance variable is simple and consistent: every instance variable belongs to whatever object is playing the role of self at the moment the code containing the instance variable is executed.
Joe Leo • The Well-Grounded Rubyist
After starting irb, you type Ruby code into it, and it executes the code and prints out the resulting value.
Joe Leo • The Well-Grounded Rubyist
But don’t methods always have to be associated with objects? Well, yes, they do, and in this case (as with puts and gets), the method is associated with the object representing the whole program.