3 ms·
Actually, it's &(:+) not &:(+). The & takes its argument and converts from a Proc to a block. :+ is a symbol that implements the method #to_proc to give you a b
by raganwald 19y ago
Actually, it's &(:+) not &:(+). The & takes its argument and converts from a Proc to a block. :+ is a symbol that implements the method #to_proc to give you a block that sums its receiver and its argument.
- kommissar 19y agoOh, cool. I knew the colon meant a Ruby symbol, but I did not know that you could use & to convert a Proc to block.