Comprehensive Ruby Programming
上QQ阅读APP看书,第一时间看更新

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.