May 2022
Beginner
352 pages
7h 5m
English
So far in this tutorial, we’ve seen several examples of Ruby functions, blocks, and methods. In this chapter, we’ll learn how to define our own functions, we’ll deepen our understanding of blocks, and we’ll learn how to chain methods. As we’ll see, the three are closely related, and in fact all of them are variations on the same basic functional theme—one of the most important ideas in Ruby, and indeed in all of computing (Figure 5.1).
Figure 5.1: Time to level up.
As we saw in Section 1.2, function calls in Ruby consist of a name and zero or more arguments:
Read now
Unlock full access