hsh.invert â new_hash
Instance Public methods
Returns a new hash created by using hsh's values as keys, and the keys as values.
h = { "n" => 100, "m" => 100, "y" => 300, "d" => 200, "a" => 0 } h.invert #=> {0=>"a", 100=>"m", 200=>"d", 300=>"y"}
Please login to continue.