christopherstyles/ngp_van

View on GitHub
lib/ngp_van/client/locations.rb

Summary

Maintainability
A
0 mins
Test Coverage
# frozen_string_literal: true

module NgpVan
  class Client
    module Locations
      def locations(params: {})
        get(path: 'locations', params: params)
      end

      def location(id:, params: {})
        verify_id(id)
        get(path: "locations/#{id}", params: params)
      end

      def find_or_create_location(body: {})
        post(path: 'locations/findOrCreate', body: body)
      end

      def create_location(body: {})
        post(path: 'locations', body: body)
      end

      def delete_location(id:)
        verify_id(id)
        delete(path: "locations/#{id}")
      end
    end
  end
end