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
50 51 52 |
# File 'lib/geo_magic/geocode/geocode_adapter.rb', line 50 def address_hash {:street => street, :postal_code => postal_code, :city => city, :state => state, :country => country, :country_code => country_code} end |
#city ⇒ Object
33 34 35 |
# File 'lib/geo_magic/geocode/geocode_adapter.rb', line 33 def city subadm_api["SubAdministrativeAreaName"] ? subadm_api["SubAdministrativeAreaName"] : "" end |
#country_code ⇒ Object
41 42 43 |
# File 'lib/geo_magic/geocode/geocode_adapter.rb', line 41 def country_code country_api["CountryNameCode"] ? country_api["CountryNameCode"] : "" end |
#country_name ⇒ Object Also known as: country
45 46 47 |
# File 'lib/geo_magic/geocode/geocode_adapter.rb', line 45 def country_name country_api["CountryName"] ? country_api["CountryName"] : "" end |
#latitude ⇒ Object
Location
56 57 58 |
# File 'lib/geo_magic/geocode/geocode_adapter.rb', line 56 def latitude coords[1] end |
#location_hash ⇒ Object
64 65 66 |
# File 'lib/geo_magic/geocode/geocode_adapter.rb', line 64 def location_hash {:longitude => longitude, :latitude => latitude} end |
#longitude ⇒ Object
60 61 62 |
# File 'lib/geo_magic/geocode/geocode_adapter.rb', line 60 def longitude coords[0] end |
#postal_code ⇒ Object Also known as: zip
28 29 30 |
# File 'lib/geo_magic/geocode/geocode_adapter.rb', line 28 def postal_code locality["PostalCode"] ? locality["PostalCode"]["PostalCodeNumber"] : "" end |
#state ⇒ Object
37 38 39 |
# File 'lib/geo_magic/geocode/geocode_adapter.rb', line 37 def state adm_api["AdministrativeAreaName"] ? adm_api["AdministrativeAreaName"] : "" end |
#street ⇒ Object
Address
24 25 26 |
# File 'lib/geo_magic/geocode/geocode_adapter.rb', line 24 def street thoroughfare["ThoroughfareName"] ? thoroughfare["ThoroughfareName"] : "" end |