Class: Harvesting::Models::Invoice
- Inherits:
-
HarvestRecord
- Object
- Base
- HarvestRecord
- Harvesting::Models::Invoice
- Defined in:
- lib/harvesting/models/invoice.rb
Overview
An invoice record from your Harvest account.
For more information: help.getharvest.com/api-v2/invoices-api/invoices/invoices/
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
Methods inherited from HarvestRecord
Methods inherited from Base
#create, #delete, #fetch, get, #initialize, #save, #to_hash, #update
Constructor Details
This class inherits a constructor from Harvesting::Models::Base
Instance Method Details
#line_items ⇒ Object
35 36 37 |
# File 'lib/harvesting/models/invoice.rb', line 35 def line_items @line_items ||= @attributes['line_items'].map { |line_item_attributes| LineItem.new line_item_attributes, { harvest_client: harvest_client } } end |
#path ⇒ Object
39 40 41 |
# File 'lib/harvesting/models/invoice.rb', line 39 def path @attributes['id'].nil? ? "invoices" : "invoices/#{@attributes['id']}" end |