Let's say I have an enumeration pool that I want to group by attribute:
cars = Car.all.group_by(&:color)
Then I want to repeat these carsas follows:
cars.inject([]) do |stack, (color, cars)|
stack << cars.each do |car|
...
end
end
What is the term for block expansion (between parentheses)?
source
share