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 ...

Get Polished Ruby Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.