Class: Harvesting::Models::HarvestRecordCollection

Inherits:
Base
  • Object
show all
Extended by:
Forwardable
Includes:
Enumerable
Defined in:
lib/harvesting/models/harvest_record_collection.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#attributes, #harvest_client

Instance Method Summary collapse

Methods included from Enumerable

#each

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

#entriesObject (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_pageObject

Raises:

  • (NotImplementedError)


37
38
39
# File 'lib/harvesting/models/harvest_record_collection.rb', line 37

def fetch_next_page
  raise NotImplementedError
end

#next_page_query_optsObject



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

#pageObject



25
26
27
# File 'lib/harvesting/models/harvest_record_collection.rb', line 25

def page
  @attributes['page']
end

#sizeObject



29
30
31
# File 'lib/harvesting/models/harvest_record_collection.rb', line 29

def size
  total_entries
end