From: Gregory Brown Date: 2009-10-27T01:16:23+09:00 Subject: Re: Hash Reverse ? On Mon, Oct 26, 2009 at 8:59 AM, salai wrote: > h = {2=>"a", 1=> "b", 3 =>"a", 4=> "a", 5 => "b", 6=>"c"} > p h.hash_revert #--> {"a"=>4, "b"=>1, "c"=>6} > > or Should I get this ?? > # => {"a"=>2, "b"=>1, "c"=>6} > > Because HASH is working like "Set" ?? See Hash#invert and perhaps its implementation. -greg