Module: GeoMagic::GeocodeAdapter::GeocodeAPI
- Defined in:
- lib/geo_magic/geocode/geocode_adapter.rb
Instance Method Summary collapse
- #address_hash ⇒ Object
- #city ⇒ Object
- #country_code ⇒ Object
- #country_name ⇒ Object (also: #country)
-
#latitude ⇒ Object
Location.
- #location_hash ⇒ Object
- #longitude ⇒ Object
- #postal_code ⇒ Object (also: #zip)
- #state ⇒ Object
-
#street ⇒ Object
Address.
Instance Method Details
#address_hash ⇒ Object
47 48 49 |
# File 'lib/geo_magic/geocode/geocode_adapter.rb', line 47 def address_hash {:street => street, :postal_code => postal_code, :city => city, :state => state, :country => country, :country_code => country_code} end |
#city ⇒ Object
30 31 32 |
# File 'lib/geo_magic/geocode/geocode_adapter.rb', line 30 def city subadm_api["SubAdministrativeAreaName"] ? subadm_api["SubAdministrativeAreaName"] : "" end |
#country_code ⇒ Object
38 39 40 |
# File 'lib/geo_magic/geocode/geocode_adapter.rb', line 38 def country_code country_api["CountryNameCode"] ? country_api["CountryNameCode"] : "" end |
#country_name ⇒ Object Also known as: country
42 43 44 |
# File 'lib/geo_magic/geocode/geocode_adapter.rb', line 42 def country_name country_api["CountryName"] ? country_api["CountryName"] : "" end |
#latitude ⇒ Object
Location
53 54 55 |
# File 'lib/geo_magic/geocode/geocode_adapter.rb', line 53 def latitude coords[1] end |
#location_hash ⇒ Object
61 62 63 |
# File 'lib/geo_magic/geocode/geocode_adapter.rb', line 61 def location_hash {:longitude => longitude, :latitude => latitude} end |
#longitude ⇒ Object
57 58 59 |
# File 'lib/geo_magic/geocode/geocode_adapter.rb', line 57 def longitude coords[0] end |
#postal_code ⇒ Object Also known as: zip
25 26 27 |
# File 'lib/geo_magic/geocode/geocode_adapter.rb', line 25 def postal_code locality["PostalCode"] ? locality["PostalCode"]["PostalCodeNumber"] : "" end |
#state ⇒ Object
34 35 36 |
# File 'lib/geo_magic/geocode/geocode_adapter.rb', line 34 def state adm_api["AdministrativeAreaName"] ? adm_api["AdministrativeAreaName"] : "" end |
#street ⇒ Object
Address
21 22 23 |
# File 'lib/geo_magic/geocode/geocode_adapter.rb', line 21 def street thoroughfare["ThoroughfareName"] ? thoroughfare["ThoroughfareName"] : "" end |