Class: Geocoder::Result::AmazonLocationService

Inherits:
Base
  • Object
show all
Defined in:
lib/geocoder/results/amazon_location_service.rb

Instance Attribute Summary

Attributes inherited from Base

#cache_hit, #data

Instance Method Summary collapse

Methods inherited from Base

#latitude, #longitude

Constructor Details

#initialize(result) ⇒ AmazonLocationService

Returns a new instance of AmazonLocationService.



5
6
7
# File 'lib/geocoder/results/amazon_location_service.rb', line 5

def initialize(result)
  @place = result
end

Instance Method Details

#addressObject



13
14
15
# File 'lib/geocoder/results/amazon_location_service.rb', line 13

def address
  @place.label
end

#cityObject



25
26
27
# File 'lib/geocoder/results/amazon_location_service.rb', line 25

def city
  @place.municipality || @place.sub_region
end

#coordinatesObject



9
10
11
# File 'lib/geocoder/results/amazon_location_service.rb', line 9

def coordinates
  [@place.geometry.point[1], @place.geometry.point[0]]
end

#countryObject



49
50
51
# File 'lib/geocoder/results/amazon_location_service.rb', line 49

def country
  @place.country
end

#country_codeObject



53
54
55
# File 'lib/geocoder/results/amazon_location_service.rb', line 53

def country_code
  @place.country
end

#neighborhoodObject



17
18
19
# File 'lib/geocoder/results/amazon_location_service.rb', line 17

def neighborhood
  @place.neighborhood
end

#postal_codeObject



45
46
47
# File 'lib/geocoder/results/amazon_location_service.rb', line 45

def postal_code
  @place.postal_code
end

#provinceObject



37
38
39
# File 'lib/geocoder/results/amazon_location_service.rb', line 37

def province
  @place.region
end

#province_codeObject



41
42
43
# File 'lib/geocoder/results/amazon_location_service.rb', line 41

def province_code
  @place.region
end

#routeObject



21
22
23
# File 'lib/geocoder/results/amazon_location_service.rb', line 21

def route
  @place.street
end

#stateObject



29
30
31
# File 'lib/geocoder/results/amazon_location_service.rb', line 29

def state
  @place.region
end

#state_codeObject



33
34
35
# File 'lib/geocoder/results/amazon_location_service.rb', line 33

def state_code
  @place.region
end