Class: Polar::Product
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/product.rb', line 10
def self.create(params)
response = Client.post_request("/v1/products", **params)
handle_one(response)
end
|
.get(id) ⇒ Object
15
16
17
18
|
# File 'lib/polar/resources/product.rb', line 15
def self.get(id)
response = Client.get_request("/v1/products/#{id}")
handle_one(response)
end
|
.list(params = {}) ⇒ Object
5
6
7
8
|
# File 'lib/polar/resources/product.rb', line 5
def self.list(params = {})
response = Client.get_request("/v1/products", **params)
handle_list(response)
end
|
.update(id, params) ⇒ Object
20
21
22
23
|
# File 'lib/polar/resources/product.rb', line 20
def self.update(id, params)
response = Client.patch_request("/v1/products/#{id}", **params)
handle_one(response)
end
|
.update_benefits(id, params) ⇒ Object
25
26
27
28
|
# File 'lib/polar/resources/product.rb', line 25
def self.update_benefits(id, params)
response = Client.post_request("/v1/products/#{id}/benefits", **params)
handle_one(response)
end
|