Skip to content

Give Null a meaningful inspect method#1

Merged
martinciu merged 1 commit into
martinciu:masterfrom
nilbus:inspect
Oct 28, 2012
Merged

Give Null a meaningful inspect method#1
martinciu merged 1 commit into
martinciu:masterfrom
nilbus:inspect

Conversation

@nilbus
Copy link
Copy Markdown
Contributor

@nilbus nilbus commented Jul 21, 2012

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
 => #<Null::Object:0x8089d624>

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

@nilbus
Copy link
Copy Markdown
Contributor Author

nilbus commented Sep 18, 2012

Any thoughts on this?

@pcreux
Copy link
Copy Markdown

pcreux commented Oct 25, 2012

👍

martinciu added a commit that referenced this pull request Oct 28, 2012
Give Null a meaningful inspect method
@martinciu martinciu merged commit e0930fa into martinciu:master Oct 28, 2012
@martinciu
Copy link
Copy Markdown
Owner

@nilbus apologize about delay. It's merged and new version of the released. Thanks!

@nilbus
Copy link
Copy Markdown
Contributor Author

nilbus commented Oct 28, 2012

Thanks! :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants