Sha256: 865bc91f5020f0ee314ef201c7ea2493d34a0cbb9a5849d9f136c39feceb5f19
Contents?: true
Size: 764 Bytes
Versions: 2
Compression:
Stored size: 764 Bytes
Contents
# frozen_string_literal: true module Regio class ReverseGeocode < Core def results raise Unprocessable, response[:message] if response[:message] response.merge( collection: response[:data]&.map { |result| transform(result) } || [] ) end private def response @response ||= run('/revgeocode', options) end # NOTE: all options described in the documentation # https://api.regio.ee/documentation/#docs/reverse_geocode def default_options { apikey: Configuration.api_key, address_format: 'long_address', details: 'id,address,ads_adr_id,postcode,type,components,geometry,is_valid,is_complete', output_format: 'json', limit: 25 } end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
regio-0.3.5 | lib/regio/reverse_geocode.rb |
regio-0.3.4 | lib/regio/reverse_geocode.rb |