Created
March 5, 2013 14:42
-
-
Save samflores/5090741 to your computer and use it in GitHub Desktop.
I found something like this in a blog post. I agree with the post subject, just don't understand why the author choose the following idiom
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
foo = case value | |
when nil | |
NullObject.new | |
else | |
value | |
end |
foo = value || NullObject.new
É bem melhor :D
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
por que não:
ou
ou ainda