Posts Tagged ‘ruby howdoyouuseautotest’

uniq uses hash and eql?

Wednesday, January 30th, 2008

If you’re wondering how to make your objects work correctly with Array#uniq, the answer is: define hash and eql?.

This is one of the most frustrating parts of Ruby: the documentation is frequently just plain bad (or absent).  I guess the advantage is that it drives people to read (and write) Ruby blogs more.