I have an array of hashes, and I want the unique values out of it. Calling Array.uniq doesn\'t give me what I expect.
Array.uniq
a = [{:a => 1},{:a =&g
found on google http://mikeburnscoder.wordpress.com/2008/01/18/uniquify-an-array-of-hashes-in-ruby/
The answer you give is similar to the one discussed here. It overrides the hash and eql? methods on the hashes that are to appear in the array which then makes uniq behave correctly.
hash
eql?
uniq