Class: Eligible::Customer

Inherits:
APIResource show all
Defined in:
lib/eligible/customer.rb

Instance Attribute Summary

Attributes inherited from EligibleObject

#api_key, #eligible_id

Class Method Summary collapse

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

.all(params, opts = {}) ⇒ Object



15
16
17
# File 'lib/eligible/customer.rb', line 15

def self.all(params, opts = {})
  send_request :get, api_url('customers'), params, **opts
end

.get(params, opts = {}) ⇒ Object



3
4
5
# File 'lib/eligible/customer.rb', line 3

def self.get(params, opts = {})
  send_request :get, api_url('customers', params, :customer_id), params, **opts.merge(required_params: [:customer_id])
end

.post(params, opts = {}) ⇒ Object



7
8
9
# File 'lib/eligible/customer.rb', line 7

def self.post(params, opts = {})
  send_request :post, api_url('customers'), params, **opts
end

.update(params, opts = {}) ⇒ Object



11
12
13
# File 'lib/eligible/customer.rb', line 11

def self.update(params, opts = {})
  send_request :put, api_url('customers', params, :customer_id), params, **opts.merge(required_params: [:customer_id])
end