Class: Eligible::V1_0::Claim

Inherits:
RestAPIBase show all
Defined in:
lib/eligible/v1_0/claim.rb

Constant Summary collapse

ENDPOINT_NAME =
'claims'.freeze

Constants inherited from RestAPIBase

RestAPIBase::REST_API_VERSION

Instance Attribute Summary

Attributes inherited from EligibleObject

#api_key, #eligible_id

Class Method Summary collapse

Methods inherited from RestAPIBase

create, list, retrieve, update

Methods inherited from APIResource

api_url, class_name, endpoint_name, require_param, required_param_validation, rest_api_params, send_request, url

Methods inherited from EligibleObject

#[], #[]=, construct_from, #each, #error, #initialize, #keys, #refresh_from, #to_hash, #to_json, #values

Constructor Details

This class inherits a constructor from Eligible::EligibleObject

Class Method Details

.cancel(id, opts = {}) ⇒ Object



20
21
22
# File 'lib/eligible/v1_0/claim.rb', line 20

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

.correct(id, opts = {}) ⇒ Object



16
17
18
# File 'lib/eligible/v1_0/claim.rb', line 16

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

.delete(_params, _opts = {}) ⇒ Object



8
9
10
# File 'lib/eligible/v1_0/claim.rb', line 8

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

.submit(id, opts = {}) ⇒ Object



12
13
14
# File 'lib/eligible/v1_0/claim.rb', line 12

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