Class: JsonApiPaginator

Inherits:
JsonApiClient::Paginating::NestedParamPaginator
  • Object
show all
Defined in:
lib/json_api_paginator.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(result_set, data) ⇒ JsonApiPaginator

Returns a new instance of JsonApiPaginator.



7
8
9
10
# File 'lib/json_api_paginator.rb', line 7

def initialize(result_set, data)
  super
  @meta = data['meta'] || {}
end

Instance Attribute Details

#metaObject (readonly)

Returns the value of attribute meta.



5
6
7
# File 'lib/json_api_paginator.rb', line 5

def meta
  @meta
end

Instance Method Details

#total_entriesObject



12
13
14
# File 'lib/json_api_paginator.rb', line 12

def total_entries
  meta['total_count'].to_i || super
end