This repository was archived by the owner on Oct 6, 2024. It is now read-only.
Repository navigation
v1.1.0
Adds offset_page pagination strategy:
Pagination strategy: offset_page
The offest_page strategy is based on the page strategy with the only difference
that the pages are counted from 0 onwards (not from 1).
# app/models/transaction.rb
class Transaction < DHS::Record
configuration pagination_strategy: 'offset_page', pagination_key: 'page'
endpoint '{+service}/transactions'
end# app/controllers/some_controller.rb
Record.allGET https://service.example.com/records?limit=100
{
items: [{...}, ...],
total: 300,
limit: 100,
page: 0
}
In parallel:
GET https://service.example.com/records?limit=100&page=1
GET https://service.example.com/records?limit=100&page=2