- Comprehensive Ruby Programming
- Jordan Hudgens
- 45字
- 2025-04-04 18:58:15
Method chaining
Another neat thing we can do is join different methods together to get a custom output. For example, I can run this:
"Astros".reverse.upcase
The preceding code displays the SORTSA value.
This practice of combining different methods with a dot is called method chaining.