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

Implement #most_specific method for result subdivisions #31

Merged
merged 2 commits into from
Dec 19, 2017

Conversation

f3ndot
Copy link
Contributor

@f3ndot f3ndot commented Dec 18, 2017

Adds feature parity with the official Python client when accessing subdivisions.

It will return the most specific (last) NamedLocation of the subdivisions array or an "empty" NamedLocation (to be consistent with Python client) if no subdivisions available.

See the official Python library for reference: https://github.com/maxmind/GeoIP2-python/blob/04c8914d6445ed21c1df9bd1476153fd5c76ef36/geoip2/records.py#L444

Happy to return nil instead of an empty NamedLocation, whatever you think is best.

Justin Bull added 2 commits December 18, 2017 14:59
Adds feature parity with the official Python client when accessing subdivisions.

It will return the most specific (last) NamedLocation of the subdivisions array or an "empty" NamedLocation (to be consistent with Python client).
@yhirose yhirose merged commit 2b657eb into yhirose:master Dec 19, 2017
@yhirose
Copy link
Owner

yhirose commented Dec 19, 2017

@f3ndot, the change looks great. thank you for your contribution! I have just bumped up the version to 0.1.15.

@f3ndot f3ndot deleted the add-most-specific branch December 19, 2017 01:29
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

Successfully merging this pull request may close these issues.

2 participants