Permalink
Browse files

Merge pull request #420 from azlantaher88/master

Added neighborhood method to Geocoder::Result::Google class
  • Loading branch information...
2 parents ea6ec79 + 30e28e9 commit fad6274103c3cc8efcc9ee84c282fa863f2040e9 @alexreisner committed Mar 20, 2013
Showing with 6 additions and 0 deletions.
  1. +6 −0 lib/geocoder/results/google.rb
View
6 lib/geocoder/results/google.rb
@@ -11,6 +11,12 @@ def address(format = :full)
formatted_address
end
+ def neighborhood
+ if neighborhood = address_components_of_type(:neighborhood).first
+ neighborhood['long_name']
+ end
+ end
+
def city
fields = [:locality, :sublocality,
:administrative_area_level_3,

0 comments on commit fad6274

Please sign in to comment.