Reputation: 4972
I would like to pass in an generated(higher order function) to a method to a ruby method . Something like this
[].select give_block
def give_block
lambda { |e| e > 1 }
end
I get an error saying
"wrong number of arguments (1 for 0)"
How could i accomplish something like this?
Upvotes: 2
Views: 296