lib/acfs/collections/paginatable.rb in acfs-0.43.1 vs lib/acfs/collections/paginatable.rb in acfs-0.43.2
- old
+ new
@@ -6,11 +6,11 @@
included do
def self.operation(_action, opts = {}, &_block)
opts[:url]
end
- attr_reader :total_pages, :current_page
+ attr_reader :total_pages, :current_page, :total_count
end
def process_response(response)
setup_params response.request.params if response.request
setup_headers response.headers
@@ -45,9 +45,13 @@
end
def setup_headers(headers)
if headers['X-Total-Pages']
@total_pages = Integer(headers['X-Total-Pages'])
+ end
+
+ if headers['X-Total-Count']
+ @total_count = Integer(headers['X-Total-Count'])
end
setup_links headers['Link'] if headers['Link']
end