class Voucherify::Service::Customers
Attributes
client[R]
Public Class Methods
new(client)
click to toggle source
# File lib/voucherify/service/customers.rb, line 8 def initialize(client) @client = client end
Public Instance Methods
create(customer)
click to toggle source
# File lib/voucherify/service/customers.rb, line 16 def create(customer) @client.post('/customers', customer.to_json) end
delete(customer_id)
click to toggle source
# File lib/voucherify/service/customers.rb, line 28 def delete(customer_id) @client.delete("/customers/#{ERB::Util.url_encode(customer_id)}") end
get(customer_id)
click to toggle source
# File lib/voucherify/service/customers.rb, line 20 def get(customer_id) @client.get("/customers/#{ERB::Util.url_encode(customer_id)}") end
list(params = {})
click to toggle source
# File lib/voucherify/service/customers.rb, line 12 def list(params = {}) @client.get('/customers', params) end
update(customer)
click to toggle source
# File lib/voucherify/service/customers.rb, line 24 def update(customer) @client.put("/customers/#{ERB::Util.url_encode(customer['id'] || customer[:id])}", customer.to_json) end
update_consents(customer_id, consents)
click to toggle source
# File lib/voucherify/service/customers.rb, line 32 def update_consents(customer_id, consents) @client.put("/customers/#{ERB::Util.url_encode(customer_id)}/consents", consents.to_json) end