Class: Harvest::API::Invoices
- Includes:
- Behavior::Crud
- Defined in:
- lib/harvest/api/invoices.rb
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#all(options = {}) ⇒ Array<Harvest::Invoice>
Retrieves invoices.
Methods included from Behavior::Crud
#create, #delete, #find, #update
Methods inherited from Base
Constructor Details
This class inherits a constructor from Harvest::API::Base
Instance Method Details
#all ⇒ Array<Harvest::Invoice> #all(options) ⇒ Array<Harvest::Invoice>
Retrieves invoices
Available options
-
:status - invoices by status
-
:page
-
:updated_since
-
:timeframe (must be a nested hash with :to and :from)
20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/harvest/api/invoices.rb', line 20 def all( = {}) query = {} query[:status] = [:status] if [:status] query[:page] = [:page] if [:page] query[:updated_since] = [:updated_since] if [:updated_since] if [:timeframe] query[:from] = [:timeframe][:from] query[:to] = [:timeframe][:to] end response = request(:get, credentials, "/invoices", :query => query) api_model.parse(response.parsed_response) end |