Chapter 4: Methods and Their Arguments
Methods are where almost all the logic is implemented in Ruby programs. Along with how you design your classes, how you design your methods makes all the difference between a library that is a joy to use and one that inspires dread. In this chapter, you'll learn how to design methods to inspire joy in the users of the methods, even if you are the only user. You'll learn how limiting the visibility of methods allows for easier refactoring down the line. You'll also gain a greater understanding of Ruby's object model by learning what class methods actually are.
In this chapter, we will cover the following topics:
- Understanding that there are no class methods, only instance methods
- Naming methods
- Using the many types of method arguments
- Learning about the importance of method visibility
- Handling delegation
By the end of this chapter, you'll have a better understanding of methods in Ruby...