Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Give Null a meaningful inspect method #1

Merged
merged 1 commit into from
Oct 28, 2012
Merged

Conversation

nilbus
Copy link
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
Contributor Author

nilbus commented Sep 18, 2012

Any thoughts on this?

@pcreux
Copy link

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
Owner

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

@nilbus
Copy link
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