Sha256: a8745c77ac5654618df3e1443122524d35dc584428c87134a158ac8672d83712

Contents?: true

Size: 698 Bytes

Versions: 5

Compression:

Stored size: 698 Bytes

Contents

module GeoNamesAPI
  class Neighbourhood < SingletonEndpoint
    METHOD = 'neighbourhoodJSON'
    FIND_PARAMS = %w(lat lng)

    def hierarchy
      %w{countryName adminName1 adminName2 city name}.map do |ea|
        @neighbourhood[ea]
      end
    end
  end
end

=begin

{
  "neighbourhood": {
    "countryName": "United States",
    "adminName1": "New York",
    "adminName2": "New York County",
    "city": "New York City-Manhattan",
    "name": "Central Park",
    "adminCode2": "061",
    "adminCode1": "NY",
    "countryCode": "US"
  }
}

or

{
  "status": {
    "message": "we are afraid we could not find a neighbourhood for latitude and longitude :XXX, YYYY",
    "value": 15
  }
}

=end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
geonames_api-0.1.6 lib/geonames_api/neighbourhood.rb
geonames_api-0.1.5 lib/geonames_api/neighbourhood.rb
geonames_api-0.1.4 lib/geonames_api/neighbourhood.rb
geonames_api-0.1.3 lib/geonames_api/neighbourhood.rb
geonames_api-0.1.2 lib/geonames_api/neighbourhood.rb