Class: BusinessCentral::SalesInvoiceLine

Inherits:
Base
  • Object
show all
Defined in:
lib/business_central/sales_invoice_line.rb

Constant Summary collapse

API_OBJECT_PARENT =
"salesInvoices"
API_OBJECT =
"salesInvoiceLines"
SUPPORTED_METHODS =
[:get, :create, :update, :delete]

Instance Attribute Summary

Attributes inherited from Base

#client

Instance Method Summary collapse

Methods inherited from Base

#build_url, #initialize, #process

Methods included from ApiMethods

#delete, #get_child, #method_missing, #query, #query_child, #update

Constructor Details

This class inherits a constructor from BusinessCentral::Base

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class BusinessCentral::ApiMethods

Instance Method Details

#create(sales_invoice_id, data) ⇒ Object



16
17
18
19
20
21
22
23
# File 'lib/business_central/sales_invoice_line.rb', line 16

def create(sales_invoice_id, data)
  url = "/#{API_OBJECT_PARENT}(#{sales_invoice_id})/#{API_OBJECT}"

  response = @client.post(url, data)
  handle_error(response)
  result = process(response)
  return result.first
end

#get(sales_invoice_id, sales_invoice_line_id = nil) ⇒ Object



12
13
14
# File 'lib/business_central/sales_invoice_line.rb', line 12

def get(sales_invoice_id, sales_invoice_line_id = nil)
  get_child(sales_invoice_id, sales_invoice_line_id)
end