This thread helped me a lot with learning the basics of Ruby, still working hard to understand how to script but it is very hard... Difficult to imagine how the Variables, Modules, Classes etc are then used to actually do things in the game! I will keep going through the tutorial I have and hopefully it will make more sense with time.
Thanks djDarkX, Zalerinian and Mouser to name a few for some good tips/advice!
Here are some analogies:
Think of a Class as an object you can perform actions to, or ask questions of. How the Class performs its actions and answers its questions is only known to the Class. Anyone else only sees what the Class will do. What a Class will do, and what questions it will answer, are its Methods. So, if I provided you a Car for a class, you wouldn't need to know the type of engine, transmission or how the pieces work. All you would see are the methods (actions or questions) available, such as: start_car, turn_left, turn_right, accelerate_to(speed), slow_to(speed) and stop_car. I might also provide some methods which tell you about the Car such as "is_running?" or "current_speed".
Inside the Car class, I would have implemented the methods, but you would not need to know how the Car is doing what it's doing. This is called "encapsulation" and is an important concept. It makes the code easier to understand and protects the insides of the Car object.
The Class is a blueprint that describes how all instances of the Car work. An Instance is a specific, actual Car. So I could create, say, a Mazda and, say, an Oldsmobile. Both would be instances of Car. But obviously one Car might be running, and the other might not. But they would both support the same Methods.
Finally, a Module is merely a container for one or more Classes.
How do you use them to solve problems?
Well, say RPG Maker has a Class called an Actor. This can represent one of the PCs. It has Methods to indicate its X,Y position on the map, the ability to see if the Actor has a certain State associated with it (i.e. the player has been Poisoned), the Max HP of the player, the current XP and Level, and so on.
Then there might be a Class called Party. A Party is the current set of Actors the player can control.
If I wanted to move the party to a location on the map, I would call a Method on the Party (which has a set of Actors, one for each PC) to change the party's location to a different X,Y position possibly on a different map.
The Methods change the internal state of the object. The net effect is the Party is now on the new X,Y position on the new map.
And, the player sees the party on the new map location.