This is Ruby 1.8 Question:
We all know how to use Array#uniq
:
[1,2,3,1].uniq #=> [1,2,3]
However I'm wondering if we can monkey patch it in a way to work with complex objects. The current behavior is like this:
[{"three"=>"3"}, {"three"=>"4"}, {"three"=>"3"}].uniq
#=> [{"three"=>"3"}, {"three"=>"4"}, {"three"=>"3"}]
The requested one is:
[{"three"=>"3"}, {"three"=>"4"}, {"three"=>"3"}].uniq
#=> [{"three"=>"3"}, {"three"=>"4"}]