Class: Lightspeed::API::Sales

Inherits:
Object
  • Object
show all
Defined in:
lib/lightspeed/api/sales.rb,
lib/lightspeed/api/sales/sale_lines.rb

Defined Under Namespace

Classes: SaleLines

Instance Method Summary collapse

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.}/Sale/#{sale_id}.json", relations: with).body
end

#sale_linesObject



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.}/Sale/#{sale_id}.json", body: attributes).body
end