martinciu/nullobject — pull request #1 by nilbus (2012-07-21 00:20:50+00:00)
Title: Give Null a meaningful inspect method

Hi Marcin,

First - thanks for throwing this gem together. Having this gem makes it
a lot easier to put the ideas from Avdi's talk and the Null Object
pattern into practice.

I added the inspect method to make debugging better. Inspecting an
object and seeing nothing at all makes it very unclear what's going on,
especially to other developers who aren't familiar with the how Null
objects act.

1.9.3p125 :001 > require './lib/nullobject'
=> true
1.9.3p125 :002 > Null::Object.instance
=> #

This is also consistent with Avdi's slides.
http://avdi.org/talks/confident-code-rubymidwest-2011/confident-code.html#slide41