Skip to content

Instantly share code, notes, and snippets.

@r00k
Last active August 29, 2015 14:20
Show Gist options
  • Save r00k/de75bc3054eec70a6d2b to your computer and use it in GitHub Desktop.
Save r00k/de75bc3054eec70a6d2b to your computer and use it in GitHub Desktop.
Quizzy Question 4

Answer to Question 3

Sure! Symbol-to-proc is what you want here:

users.select(&:admin?)

Note that we couldn't use this if admin? took an argument, which is kind of a bummer.

Question 4

Is there a more direct way to accomplish this?

widgets.select { |widget| widget.size > 3 }.first
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment