inject()
can take a block or a symbol, but map()
always takes a block. I think your working map()
is concise enough.
:*
is the symbol name for the multiplication method.
Update: I think your working map()
is fine, but it seems like what you might be looking for is the classic map/reduce, even though it's actually longer:
[[1,2], [3,4], [5,6]].map{|a| a.reduce(:*)}