Chapter 3. Programmer Utilities

image with no caption

This chapter is primarily geared toward tools that reveal more about Ruby, making the programmer’s job both easier and more interesting. We’ll revisit a few topics we broached in a cursory fashion earlier in the book, this time giving them more attention.

#5 What Is Truth? (boolean_golf.rb)

Back in Chapter 1, we talked about how various languages convert data from one type to another. You’ll remember that this process is called casting, and Ruby generally requires programmers to do this explicitly, while some other languages provide shortcuts that implicitly cast data.

The one major exception to this policy in Ruby is ...

Get Ruby by Example 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.