Is there a nicer way to write something like:
array.each { |item| method(item) }
I'm aware of array.each(&:method)
which calls the method on each item, but is there a similar shorthand for calling a method with each item?
Is there a nicer way to write something like:
array.each { |item| method(item) }
I'm aware of array.each(&:method)
which calls the method on each item, but is there a similar shorthand for calling a method with each item?