Chapter 3. Organizing objects with classes
This chapter covers
- Creating multiple objects with classes
- Setting and reading object state
- Automating creation of attribute read and write methods
- Class inheritance mechanics
- Syntax and semantics of Ruby constants
Creating a new object with Object.new—and equipping that object with its own methods, one method at a time—is a great way to get a feel for the object-centeredness of Ruby programming. But this approach doesn’t exactly scale; if you’re running an online box office and your database has to process records for tickets by the hundreds, you’ve got to find another way to create and manipulate ticket-like objects in your Ruby programs.
Sure enough, Ruby gives you a full suite of programming techniques ...