Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return full response for Directions API #6

Open
SunnyKarma opened this issue Sep 11, 2016 · 0 comments
Open

Return full response for Directions API #6

SunnyKarma opened this issue Sep 11, 2016 · 0 comments

Comments

@SunnyKarma
Copy link

return get('/maps/api/directions/json', params)[:routes]

At this moment, client.directions returns only [:routes] element of the JSON response from Google Directions API. But in some cases it needs to handle [:status] element or [:available_travel_modes]. So it could be better if it just returns full response or we can specify it.

jguthrie100 added a commit to jguthrie100/google-maps-services-ruby that referenced this issue Jun 3, 2017
…amuel#6)

Added a feature that allows 'return_type: :all' to be passed into the client.directions method, which returns the full Hash output, rather than just the [:routes] entry

Can change the argument to be 'return_type: :status' if you just want the status, or leave it blank to get the [:routes] value (i.e. the same output as is the case without this change)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant