Class: Harvesting::Models::HarvestRecordCollection
- Extended by:
- Forwardable
- Includes:
- Enumerable
- Defined in:
- lib/harvesting/models/harvest_record_collection.rb
Direct Known Subclasses
Clients, Invoices, ProjectTaskAssignments, ProjectUserAssignments, Projects, Tasks, TimeEntries, Users
Instance Attribute Summary collapse
-
#entries ⇒ Object
readonly
Returns the value of attribute entries.
Attributes inherited from Base
Instance Method Summary collapse
- #fetch_next_page ⇒ Object
-
#initialize(attrs, query_opts = {}, opts = {}) ⇒ HarvestRecordCollection
constructor
A new instance of HarvestRecordCollection.
- #next_page_query_opts ⇒ Object
- #page ⇒ Object
- #size ⇒ Object
Methods included from Enumerable
Methods inherited from Base
#create, #delete, #fetch, get, #save, #to_hash, #update
Constructor Details
#initialize(attrs, query_opts = {}, opts = {}) ⇒ HarvestRecordCollection
Returns a new instance of HarvestRecordCollection.
19 20 21 22 23 |
# File 'lib/harvesting/models/harvest_record_collection.rb', line 19 def initialize(attrs, query_opts = {}, opts = {}) super(attrs, opts) @query_opts = query_opts @api_page = attrs end |
Instance Attribute Details
#entries ⇒ Object (readonly)
Returns the value of attribute entries.
17 18 19 |
# File 'lib/harvesting/models/harvest_record_collection.rb', line 17 def entries @entries end |
Instance Method Details
#fetch_next_page ⇒ Object
37 38 39 |
# File 'lib/harvesting/models/harvest_record_collection.rb', line 37 def fetch_next_page raise NotImplementedError end |
#next_page_query_opts ⇒ Object
33 34 35 |
# File 'lib/harvesting/models/harvest_record_collection.rb', line 33 def next_page_query_opts @query_opts.merge(page: page + 1) end |
#page ⇒ Object
25 26 27 |
# File 'lib/harvesting/models/harvest_record_collection.rb', line 25 def page @attributes['page'] end |
#size ⇒ Object
29 30 31 |
# File 'lib/harvesting/models/harvest_record_collection.rb', line 29 def size total_entries end |