Ruby’s core library defines a rich and powerful API that serves as
a platform on which to create your programs. It is well worth your time to
study and master this API, particularly the key classes such as
IO. If you aren’t familiar with the methods
defined by these classes, you may end up spending time reinventing functionality that is already
provided for you.
This chapter documents those methods. It is not a comprehensive API reference, but attempts to illustrate, with short code snippets, the use of the important methods of all the important core classes and modules, and a few of the most commonly used classes from the standard library. The aim is to familiarize you with the broad range of existing methods, so that when you need one of them, you will remember that it exists and will be able to find its documentation with ri.
This is a long chapter, broken down into sections that cover the following:
Strings and text processing
Numbers and math
Dates and times
Enumerable module and the
Input/output and files
Threads and concurrency
You’ll find that the code early in the chapter takes the form of one-line snippets demonstrating individual methods. Toward the end, however, when documenting networking and threads, the examples become longer and demonstrate how ...