Sha256: 44e4d402387a954c7ca18f95883e402e47edbadf07efb006cba398183680a49a
Contents?: true
Size: 753 Bytes
Versions: 4
Compression:
Stored size: 753 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,postcode,type,components,geometry,is_valid,is_complete', output_format: 'json', limit: 25 } end end end
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
regio-0.3.3 | lib/regio/reverse_geocode.rb |
regio-0.3.2 | lib/regio/reverse_geocode.rb |
regio-0.3.1 | lib/regio/reverse_geocode.rb |
regio-0.3.0 | lib/regio/reverse_geocode.rb |