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

Conversation

Projects
None yet
3 participants
@nilbus
Contributor

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

This comment has been minimized.

Show comment
Hide comment
@nilbus

nilbus Sep 18, 2012

Contributor

Any thoughts on this?

Contributor

nilbus commented Sep 18, 2012

Any thoughts on this?

@pcreux

This comment has been minimized.

Show comment
Hide comment

pcreux commented Oct 25, 2012

👍

martinciu added a commit that referenced this pull request Oct 28, 2012

Merge pull request #1 from nilbus/inspect
Give Null a meaningful inspect method

@martinciu martinciu merged commit e0930fa into martinciu:master Oct 28, 2012

@martinciu

This comment has been minimized.

Show comment
Hide comment
@martinciu

martinciu Oct 28, 2012

Owner

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

Owner

martinciu commented Oct 28, 2012

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

@nilbus

This comment has been minimized.

Show comment
Hide comment
@nilbus

nilbus Oct 28, 2012

Contributor

Thanks! :-)

Contributor

nilbus commented Oct 28, 2012

Thanks! :-)

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