Class: Polar::Customer

Inherits:
Resource
  • Object
show all
Defined in:
lib/polar/resources/customer.rb

Class Method Summary collapse

Methods inherited from Resource

handle_list, handle_none, handle_one

Class Method Details

.create(params) ⇒ Object



10
11
12
13
# File 'lib/polar/resources/customer.rb', line 10

def self.create(params)
  response = Client.post_request("/v1/customers", **params)
  handle_one(response)
end

.delete(id) ⇒ Object



25
26
27
28
# File 'lib/polar/resources/customer.rb', line 25

def self.delete(id)
  response = Client.delete_request("/v1/customers/#{id}")
  handle_none(response)
end

.get(id) ⇒ Object



15
16
17
18
# File 'lib/polar/resources/customer.rb', line 15

def self.get(id)
  response = Client.get_request("/v1/customers/#{id}")
  handle_one(response)
end

.list(params = {}) ⇒ Object



5
6
7
8
# File 'lib/polar/resources/customer.rb', line 5

def self.list(params = {})
  response = Client.get_request("/v1/customers", **params)
  handle_list(response)
end

.update(id, params) ⇒ Object



20
21
22
23
# File 'lib/polar/resources/customer.rb', line 20

def self.update(id, params)
  response = Client.patch_request("/v1/customers/#{id}", **params)
  handle_one(response)
end