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.
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.
Is there a more direct way to accomplish this?
widgets.select { |widget| widget.size > 3 }.first