Sha256: bca33ef59455136c8180159dad2f90445e5950cb6920d59f8bc99ca4648289a1

Contents?: true

Size: 821 Bytes

Versions: 4

Compression:

Stored size: 821 Bytes

Contents

# frozen_string_literal: true

module Eligible
  module V1_0
    class Claim < RestAPIBase
      ENDPOINT_NAME = 'claims'.freeze

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

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

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

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

Version data entries

4 entries across 4 versions & 1 rubygems

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