Ok.. I'll give real example to show what is typical use case for us: hash = MyDatabaseObject.get_all.infuse({}) { |h, r| h[normalize_db_key(r.id, r.name)] = r } after that, code can quickly access any record by id and name saying obj ...EdvardM (Edvard Majakari)
I also noticed mapAccum* is quite different. I have to agree with Rodrigo. (each_)with_object seems to really do the thing, but the name is a bit funny one. Then again, that could be just simply aliased in the code for accumulating.EdvardM (Edvard Majakari)
with Ruby, we often use this idiom to build a hash out of something: new_hash = enum.inject({}) { |h, thing| h[compute_key(thing) = compute_value(thing)]; h } while that last h is very easy to add, it is also easy to forget and fee...EdvardM (Edvard Majakari)