diff --git a/lib/geocoder/results/google.rb b/lib/geocoder/results/google.rb index f9a708a197772834c882490a509fbc3efb80fca7..8b03860e85cb01d7418b208d5a0690a8f66b0bbf 100644 --- a/lib/geocoder/results/google.rb +++ b/lib/geocoder/results/google.rb @@ -41,6 +41,18 @@ module Geocoder::Result end end + def sub_state + if state = address_components_of_type(:administrative_area_level_2).first + state['long_name'] + end + end + + def sub_state_code + if state = address_components_of_type(:administrative_area_level_2).first + state['short_name'] + end + end + def country if country = address_components_of_type(:country).first country['long_name']