Most Rubyists probably know that nil in Ruby is an instance of the singleton class NilClass. Because nil is a object like any other, we can actually invoke methods on it, and it turns out that NilClass provides a few - mostly conversion methods to other Ruby types. Let’s see some of those in action: irb(main):001:0> nil.to_h => {} irb(main):002:0> nil.to_a => [] irb(main):003:0> nil.to_s => "" irb(main):004:0> nil.to_f => 0.0 irb(main):005:0> nil.to_i => 0 irb(main):006:0> nil.to_c => (0+0i...