class Geocoder::Result::GeoportailLu
Public Instance Methods
address()
click to toggle source
# File lib/geocoder/results/geoportail_lu.rb, line 10 def address full_address end
city()
click to toggle source
# File lib/geocoder/results/geoportail_lu.rb, line 14 def city try_to_extract 'locality', detailled_address end
coordinates()
click to toggle source
# File lib/geocoder/results/geoportail_lu.rb, line 6 def coordinates geomlonlat['coordinates'].reverse if geolocalized? end
detailled_address()
click to toggle source
# File lib/geocoder/results/geoportail_lu.rb, line 50 def detailled_address data['AddressDetails'] end
full_address()
click to toggle source
# File lib/geocoder/results/geoportail_lu.rb, line 42 def full_address data['address'] end
geomlonlat()
click to toggle source
# File lib/geocoder/results/geoportail_lu.rb, line 46 def geomlonlat data['geomlonlat'] end
postal_code()
click to toggle source
# File lib/geocoder/results/geoportail_lu.rb, line 26 def postal_code try_to_extract 'zip', detailled_address end
state()
click to toggle source
# File lib/geocoder/results/geoportail_lu.rb, line 18 def state 'Luxembourg' end
state_code()
click to toggle source
# File lib/geocoder/results/geoportail_lu.rb, line 22 def state_code 'LU' end
Also aliased as: country_code, province_code
street()
click to toggle source
# File lib/geocoder/results/geoportail_lu.rb, line 38 def street try_to_extract 'street', detailled_address end
street_address()
click to toggle source
# File lib/geocoder/results/geoportail_lu.rb, line 30 def street_address [street_number, street].compact.join(' ') end
street_number()
click to toggle source
# File lib/geocoder/results/geoportail_lu.rb, line 34 def street_number try_to_extract 'postnumber', detailled_address end
Private Instance Methods
geolocalized?()
click to toggle source
# File lib/geocoder/results/geoportail_lu.rb, line 61 def geolocalized? !!try_to_extract('coordinates', geomlonlat) end
try_to_extract(key, hash)
click to toggle source
# File lib/geocoder/results/geoportail_lu.rb, line 65 def try_to_extract(key, hash) if hash.is_a?(Hash) and hash.include?(key) hash[key] end end