Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change Object#try to raise NoMethodError on private methods and alway…
…s return nil when Object is nil [Pratik Naik, Lawrence Pit]
- Loading branch information
Showing
3 changed files
with
13 additions
and
11 deletions.
There are no files selected for viewing
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
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
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
5339f81
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm…
so .try becomes the same as .andand?
http://github.com/raganwald/andand
Before it was subtly different,
although I can’t think of a reason to use it as it was.
5339f81
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this change was probably “inspired” by this post:
http://blog.lawrencepit.com/2009/01/11/try-as-you-might/
5339f81
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great! So much more useful and reliable.
5339f81
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, that’s much more readable than
5339f81
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/foo/big.long.expression/ and it makes sense
5339f81
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
xaviershay:
I just think it’s asking for trouble to give people ways to hide their failures away and not deal with them. But… de gustibus non est disputandum.
5339f81
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for the dullards in the audience (me) the latin is “There’s no accounting for taste.” which I reckon is spot on in this case