diff --git a/lib/geocoder/results/google.rb b/lib/geocoder/results/google.rb index e293c0ba12b6bea6683ec43ec7a7ff0af3c6f956..4250ce0f732b43bee5309d91bf0d75501ef64eec 100644 --- a/lib/geocoder/results/google.rb +++ b/lib/geocoder/results/google.rb @@ -35,6 +35,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']