All this stuff is called inject: http://ruby-doc.org/core-1.9.3/Enumerable.html#method-i-inject
@db.keys.inject({}) { |clone_db, checksum|
  ...
  clone_db
}