invert()
public
Returns a Hash (not a DBM
database) created by using each value in
the database as a key, with the corresponding key as its value.
Note that all values in the hash will
be Strings, but the keys will be actual objects.
Show source
def invert
h = {}
keys.each { |k| h[ self.fetch( k ) ] = k }
h
end