Created
October 13, 2014 14:09
-
-
Save andremedeiros/ac11393f6703d768c591 to your computer and use it in GitHub Desktop.
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
yes = -> { puts "Y"; true } | |
no = -> { puts "N"; false } | |
arr = [no, no, no, yes, no, no] | |
a = arr.find { |x| x.call } | |
puts a | |
# `a` wants to be true, not an instance of Proc |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment