Class: Harvest::API::Invoices
- Inherits:
-
Base
- Object
- Base
- Harvest::API::Invoices
- Includes:
- Behavior::Crud
- Defined in:
- lib/forecast/api/invoices.rb
Instance Method Summary collapse
-
#all(options = {}) ⇒ Array<Harvest::Invoice>
Retrieves invoices.
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/forecast/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 |