March 2002
Beginner
560 pages
12h 14m
English
When it comes to deciding which classes and modules to put in what files, Ruby allows all sorts of permutations. You have to consider what you, and perhaps other people, might want to do with your code later.
One option that you have is to put each class in a different file. You can also group more than one class in one file, if you want.
There's a convention in other object-oriented languages of creating one file for every class defined. When you write something in Java, for example, you end up with many files, each containing the code for a single class.
This practice is less strictly followed in Ruby; you'll often see a program source file with more than one class definition in it. When it comes ...
Read now
Unlock full access