Sha256: 7d0f0c0a1c897ae12b7ba4b409c3748d7fbc17dfa1116c2a51d6c21bd7a8fa06
Contents?: true
Size: 744 Bytes
Versions: 1
Compression:
Stored size: 744 Bytes
Contents
# frozen_string_literal: true module Regio class Geocode < Core def results raise Unprocessable, response[:message] if response[:message] response.merge( collection: response[:data]&.map { |result| transform(result) } || [] ) end private def response run('/geocode', options) end # NOTE: all options described in the documentation # https://api.regio.ee/documentation/#docs/geocode def default_options { country: 'ee', 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
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
regio-0.2.0 | lib/regio/geocode.rb |