Like Array#indexOf but for objects used like hashes