sdbm.invert â Hash
Instance Public methods
Returns a Hash in which the key-value pairs have been inverted.
Example:
require 'sdbm'
SDBM.open 'my_database' do |db|
db.update('apple' => 'fruit', 'spinach' => 'vegetable')
db.invert #=> {"fruit" => "apple", "vegetable" => "spinach"}
end
Please login to continue.