Class: Lightspeed::API::Sales::SaleLines
- Inherits:
-
Object
- Object
- Lightspeed::API::Sales::SaleLines
- Defined in:
- lib/lightspeed/api/sales/sale_lines.rb
Instance Method Summary collapse
- #all(sale_id) ⇒ Object
- #create(attributes = {}) ⇒ Object
-
#initialize(client) ⇒ SaleLines
constructor
A new instance of SaleLines.
Constructor Details
#initialize(client) ⇒ SaleLines
Returns a new instance of SaleLines.
5 6 7 |
# File 'lib/lightspeed/api/sales/sale_lines.rb', line 5 def initialize(client) @client = client end |
Instance Method Details
#all(sale_id) ⇒ Object
9 10 11 12 13 |
# File 'lib/lightspeed/api/sales/sale_lines.rb', line 9 def all(sale_id) client. get("Account/#{client.account_id}/Sale/#{sale_id}/SaleLine.json"). body end |
#create(attributes = {}) ⇒ Object
15 16 17 |
# File 'lib/lightspeed/api/sales/sale_lines.rb', line 15 def create(attributes = {}) client.post("Account/#{client.account_id}/Sale/#{attributes[:saleID]}/SaleLine.json", body: attributes).body end |