From 44a6212dfe7085782dc341f601838170ebbd09b1 Mon Sep 17 00:00:00 2001 From: Alex Reisner <alex@alexreisner.com> Date: Wed, 22 Aug 2012 18:01:24 -0400 Subject: [PATCH] Suburb is in the address hash. Thanks github.com/johanneswuerbach. --- lib/geocoder/results/nominatim.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/geocoder/results/nominatim.rb b/lib/geocoder/results/nominatim.rb index a56bae86..05e51805 100644 --- a/lib/geocoder/results/nominatim.rb +++ b/lib/geocoder/results/nominatim.rb @@ -61,13 +61,17 @@ module Geocoder::Result @data['address']['country_code'] end + def suburb + @data['address']['suburb'] + end + def coordinates [@data['lat'].to_f, @data['lon'].to_f] end def self.response_attributes - %w[place_id osm_type osm_id boundingbox license - polygonpoints display_name class type stadium suburb] + %w[place_id osm_type osm_id boundingbox license + polygonpoints display_name class type stadium] end response_attributes.each do |a| -- GitLab