sdbm.invert â Hash
Instance Public methods
Returns a Hash in which the key-value pairs have been inverted.
Example:
1 2 3 4 5 6 7 | 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.