Class: Lightspeed::API::Sales
- Inherits:
-
Object
- Object
- Lightspeed::API::Sales
- Defined in:
- lib/lightspeed/api/sales.rb,
lib/lightspeed/api/sales/sale_lines.rb
Defined Under Namespace
Classes: SaleLines
Instance Method Summary collapse
- #find(sale_id, with: []) ⇒ Object
-
#initialize(client) ⇒ Sales
constructor
A new instance of Sales.
- #sale_lines ⇒ Object
- #update(sale_id, attributes = {}) ⇒ Object
Constructor Details
#initialize(client) ⇒ Sales
Returns a new instance of Sales.
6 7 8 |
# File 'lib/lightspeed/api/sales.rb', line 6 def initialize(client) @client = client end |
Instance Method Details
#find(sale_id, with: []) ⇒ Object
12 13 14 |
# File 'lib/lightspeed/api/sales.rb', line 12 def find(sale_id, with: []) client.get("Account/#{client.account_id}/Sale/#{sale_id}.json", relations: with).body end |
#sale_lines ⇒ Object
10 |
# File 'lib/lightspeed/api/sales.rb', line 10 def sale_lines; API::Sales::SaleLines.new(client); end |
#update(sale_id, attributes = {}) ⇒ Object
16 17 18 |
# File 'lib/lightspeed/api/sales.rb', line 16 def update(sale_id, attributes = {}) client.put("Account/#{client.account_id}/Sale/#{sale_id}.json", body: attributes).body end |