Skalar / google_distance_matrix

Ruby client for The Google Distance Matrix API.
MIT License
57 stars 45 forks source link

Place comparison is not working with == #47

Closed brauliomartinezlm closed 5 years ago

brauliomartinezlm commented 5 years ago

I detected that Place object comparison was not working properly with == and only eql? was overwritten.

This causes methods things like https://github.com/Skalar/google_distance_matrix/blob/master/lib/google_distance_matrix/routes_finder.rb#L23 and https://github.com/Skalar/google_distance_matrix/blob/master/lib/google_distance_matrix/routes_finder.rb#L59 will not work properly as they are comparing Place objects with diff object_id as Array#includes? does not use eql?.

I'm opening a PR with tests to better explain and attempt to fix it.

thhermansen commented 5 years ago

Thank you. I have merged your pull request.