Sha256: c446e259c8d20e0035677dae64255266f6a2c4685dc293d80e9f9ad1ebd99c5a

Contents?: true

Size: 968 Bytes

Versions: 5

Compression:

Stored size: 968 Bytes

Contents

# frozen_string_literal: true

module Eligible
  module V1_0
    class Estimate < RestAPIBase
      ENDPOINT_NAME = 'estimates'.freeze

      def self.process(id, opts = {})
        send_request :post, "/#{endpoint_name}/#{object_id(id)}/process", rest_api_params(id), **opts.merge(required_params: [:id])
      end

      def self.reestimate(id, opts = {})
        send_request :post, "/#{endpoint_name}/#{object_id(id)}/reestimate", rest_api_params(id), **opts.merge(required_params: [:id])
      end

      def self.convert(id, opts = {})
        send_request :post, "/#{endpoint_name}/#{object_id(id)}/convert", rest_api_params(id), **opts.merge(required_params: [:id])
      end

      def self.update(_params, _opts = {})
        fail NotImplementedError, "Not an allowed operation for this endpoint"
      end

      def self.delete(_params, _opts = {})
        fail NotImplementedError, "Not an allowed operation for this endpoint"
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
eligible-3.1.0.beta5 lib/eligible/v1_0/estimate.rb
eligible-3.1.0.beta4 lib/eligible/v1_0/estimate.rb
eligible-3.1.0.beta3 lib/eligible/v1_0/estimate.rb
eligible-3.1.0.beta2 lib/eligible/v1_0/estimate.rb
eligible-3.1.0.beta1 lib/eligible/v1_0/estimate.rb