Module: GeoMagic::GeocodeAdapter::GeocodeAPI

Defined in:
lib/geo_magic/geocode/geocode_adapter.rb

Instance Method Summary collapse

Instance Method Details

#address_hashObject



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

#cityObject



33
34
35
# File 'lib/geo_magic/geocode/geocode_adapter.rb', line 33

def city
  subadm_api["SubAdministrativeAreaName"] ? subadm_api["SubAdministrativeAreaName"] : ""
end

#country_codeObject



41
42
43
# File 'lib/geo_magic/geocode/geocode_adapter.rb', line 41

def country_code
  country_api["CountryNameCode"] ? country_api["CountryNameCode"] : ""
end

#country_nameObject 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

#latitudeObject

Location



56
57
58
# File 'lib/geo_magic/geocode/geocode_adapter.rb', line 56

def latitude
  coords[1]
end

#location_hashObject



64
65
66
# File 'lib/geo_magic/geocode/geocode_adapter.rb', line 64

def location_hash
  {:longitude => longitude, :latitude => latitude}
end

#longitudeObject



60
61
62
# File 'lib/geo_magic/geocode/geocode_adapter.rb', line 60

def longitude
  coords[0]
end

#postal_codeObject 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

#stateObject



37
38
39
# File 'lib/geo_magic/geocode/geocode_adapter.rb', line 37

def state
  adm_api["AdministrativeAreaName"] ? adm_api["AdministrativeAreaName"] : ""
end

#streetObject

Address



24
25
26
# File 'lib/geo_magic/geocode/geocode_adapter.rb', line 24

def street
  thoroughfare["ThoroughfareName"] ? thoroughfare["ThoroughfareName"] : ""
end