enum #find ifnone parameter can now be non-callable #186
+8
−3
mrmargolis
commented
Sep 24, 2012
@nobu Let me know if that was not what you were suggesting. I am new to editing ruby :) |
|
mrmargolis
commented
Oct 5, 2012
Thanks @nobu. I have implemented your approach. |
Closing this, please refer to Feature #7394 in redmine |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In trunk the Enumerable
#find
methodifnone
parameter has to be callable ornil
. I found that sometimes I want to return a simple value without wrapping it in a proc. This pull request adds support for non-callable defaults when no items match.