09 Sep '13, 9pm

Fold/Reduce no Ruby se chama "inject" WTF!?

If you specify a block, then for each element in enum the block is passed an accumulator value (memo ) and the element. If you specify a symbol instead, then each element in the collection will be passed to the named method of memo . In either case, the result becomes the new value for memo . At the end of the iteration, the final value of memo is the return value for the method.

Full article: http://apidock.com/ruby/Enumerable/inject


A couple of useful extensions to Ruby's Enumera...

rubyflow.com 03 Sep '13, 1pm

A couple of useful extensions to Ruby's Enumerable module Posted by bozhidar on September 03, 2013 — 0 comments I just wro...