Skip to content

Instantly share code, notes, and snippets.

@andremedeiros
Created October 13, 2014 14:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andremedeiros/ac11393f6703d768c591 to your computer and use it in GitHub Desktop.
Save andremedeiros/ac11393f6703d768c591 to your computer and use it in GitHub Desktop.
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