Rubyists: What is this called?
- by Matt Darby
Say I have a pool of enumerables that I want to group by an attribute:
cars = Car.all.group_by(&:color)
Then I want to iterate over those cars like so:
cars.inject([]) do |stack, (color, cars)|
stack << cars.each do |car|
...
end
end
What is the term for the block variable extension (between the parentheses)?