I like `inject`, because it is exactly meant for that pattern. Otherwise you would have to define a hash variable outside of the block, fill it inside and return it at the end.