Class: Lightspeed::API::Customers
- Inherits:
-
Object
- Object
- Lightspeed::API::Customers
- Defined in:
- lib/lightspeed/api/customers.rb
Instance Method Summary collapse
- #create(attributes = {}) ⇒ Object
- #find(customer_id, with: []) ⇒ Object
-
#initialize(client) ⇒ Customers
constructor
A new instance of Customers.
- #update(customer_id, attributes = {}) ⇒ Object
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.account_id}/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.account_id}/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.account_id}/Customer/#{customer_id}.json", body: attributes) end |