Class: Geocoder::Result::GeoportailLu

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

Instance Attribute Summary

Attributes inherited from Base

#cache_hit, #data

Instance Method Summary collapse

Methods inherited from Base

#initialize, #latitude, #longitude

Constructor Details

This class inherits a constructor from Geocoder::Result::Base

Instance Method Details

#addressObject



10
11
12
# File 'lib/geocoder/results/geoportail_lu.rb', line 10

def address
  full_address
end

#cityObject



14
15
16
# File 'lib/geocoder/results/geoportail_lu.rb', line 14

def city
  try_to_extract 'locality', detailled_address
end

#coordinatesObject



6
7
8
# File 'lib/geocoder/results/geoportail_lu.rb', line 6

def coordinates
  geomlonlat['coordinates'].reverse if geolocalized?
end

#detailled_addressObject



50
51
52
# File 'lib/geocoder/results/geoportail_lu.rb', line 50

def detailled_address
  data['AddressDetails']
end

#full_addressObject



42
43
44
# File 'lib/geocoder/results/geoportail_lu.rb', line 42

def full_address
  data['address']
end

#geomlonlatObject



46
47
48
# File 'lib/geocoder/results/geoportail_lu.rb', line 46

def geomlonlat
  data['geomlonlat']
end

#postal_codeObject



26
27
28
# File 'lib/geocoder/results/geoportail_lu.rb', line 26

def postal_code
  try_to_extract 'zip', detailled_address
end

#stateObject Also known as: country, province



18
19
20
# File 'lib/geocoder/results/geoportail_lu.rb', line 18

def state
  'Luxembourg'
end

#state_codeObject Also known as: country_code, province_code



22
23
24
# File 'lib/geocoder/results/geoportail_lu.rb', line 22

def state_code
  'LU'
end

#streetObject



38
39
40
# File 'lib/geocoder/results/geoportail_lu.rb', line 38

def street
  try_to_extract 'street', detailled_address
end

#street_addressObject



30
31
32
# File 'lib/geocoder/results/geoportail_lu.rb', line 30

def street_address
  [street_number, street].compact.join(' ')
end

#street_numberObject



34
35
36
# File 'lib/geocoder/results/geoportail_lu.rb', line 34

def street_number
  try_to_extract 'postnumber', detailled_address
end