Sha256: 7c6972d0cd0e81667d0c1a0b87b6f04647301eb8a70e5ca0393b2bfb0d63211a

Contents?: true

Size: 740 Bytes

Versions: 10

Compression:

Stored size: 740 Bytes

Contents

# frozen_string_literal: true

module EpsRapid
  class Geography
    def self.regions_list(**params)
      params.merge!({ include: 'standard' }) if params[:include].nil?
      EpsRapid::Client.get('regions', params)
    end

    def self.region(region_id, **params)
      params.merge!({ include: 'details' }) if params[:include].nil?
      EpsRapid::Client.get("regions/#{region_id}", params)
    end

    def self.create_polygon(body)
      params = { include: 'property_ids' }
      body =
        {
          type: 'Polygon',
          coordinates: [body]
        }
      EpsRapid::Client.post('properties/geography', body, params)
    end

    def self.map_includes(includes)
      includes.gsub(' ', '').split(',')
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
eps-rapid-1.4.0 lib/eps-rapid/geography.rb
eps-rapid-1.3.0 lib/eps-rapid/geography.rb
eps-rapid-1.2.1 lib/eps-rapid/geography.rb
eps-rapid-1.2.0 lib/eps-rapid/geography.rb
eps-rapid-1.1.3 lib/eps-rapid/geography.rb
eps-rapid-1.1.2 lib/eps-rapid/geography.rb
eps-rapid-1.1.1 lib/eps-rapid/geography.rb
eps-rapid-1.1.0 lib/eps-rapid/geography.rb
eps-rapid-1.0.1 lib/eps-rapid/geography.rb
eps-rapid-1.0.0 lib/eps-rapid/geography.rb