Class: Lightspeed::API::Customers

Inherits:
Object
  • Object
show all
Defined in:
lib/lightspeed/api/customers.rb

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Customers

Returns a new instance of Customers.



4
5
6
# File 'lib/lightspeed/api/customers.rb', line 4

def initialize(client)
  @client = client
end

Instance Method Details

#create(attributes = {}) ⇒ Object



12
13
14
# File 'lib/lightspeed/api/customers.rb', line 12

def create(attributes = {})
  client.post("Account/#{client.}/Customer.json", body: attributes).body
end

#find(customer_id, with: []) ⇒ Object



8
9
10
# File 'lib/lightspeed/api/customers.rb', line 8

def find(customer_id, with: [])
  client.get("Account/#{client.}/Customer/#{customer_id}.json", relations: with).body
end

#update(customer_id, attributes = {}) ⇒ Object



16
17
18
# File 'lib/lightspeed/api/customers.rb', line 16

def update(customer_id, attributes = {})
  client.put("Account/#{client.}/Customer/#{customer_id}.json", body: attributes)
end