Swapping the keys and values

h = {'a' => 'a123', 'b' => 'b123'}  #=> {"a"=>"a123", "b"=>"b123"}
h.invert                            #=> {"a123"=>"a", "b123"=>"b"}

Tags:
Source:
2000hrs.txt
Published:
10-05-2012 20:00