Method: PureCDB::Reader#each

Defined in:
lib/purecdb/reader.rb

#eachObject

Iterate over all key/value pairs in the order they occur in the file. This is not sorted or insertion order.

each will yield each key,value pair separately even when a key is duplicate.



96
97
98
99
100
101
102
103
104
# File 'lib/purecdb/reader.rb', line 96

def each
  pos = hash_size
  hoff0 = @hashes[0]
  while pos < hoff0
    key, value = *read_entry(pos)
    yield(key,value)
    pos += key.length + value.length + hashref_size
  end
end