Class: Sink::Resources::PaginationTests::Offset
- Inherits:
-
Object
- Object
- Sink::Resources::PaginationTests::Offset
- Defined in:
- lib/sink/resources/pagination_tests/offset.rb
Instance Method Summary collapse
-
#initialize(client:) ⇒ Offset
constructor
A new instance of Offset.
-
#list(params = {}, opts = {}) ⇒ Sink::PageOffset<Sink::Models::MyModel>
Test case for offset pagination.
-
#list_no_start_field(params = {}, opts = {}) ⇒ Sink::PageOffsetNoStartField<Sink::Models::MyModel>
Test case for offset pagination with no start response field.
-
#with_total_count(params = {}, opts = {}) ⇒ Sink::PageOffsetTotalCount<Sink::Models::MyModel>
Test case for offset pagination with a total count response property.
Constructor Details
#initialize(client:) ⇒ Offset
Returns a new instance of Offset.
8 9 10 |
# File 'lib/sink/resources/pagination_tests/offset.rb', line 8 def initialize(client:) @client = client end |
Instance Method Details
#list(params = {}, opts = {}) ⇒ Sink::PageOffset<Sink::Models::MyModel>
Test case for offset pagination
21 22 23 24 25 26 27 28 29 30 |
# File 'lib/sink/resources/pagination_tests/offset.rb', line 21 def list(params = {}, opts = {}) req = { method: :get, path: "/paginated/offset", query: params, page: Sink::PageOffset, model: Sink::Models::MyModel } @client.request(req, opts) end |
#list_no_start_field(params = {}, opts = {}) ⇒ Sink::PageOffsetNoStartField<Sink::Models::MyModel>
Test case for offset pagination with no start response field
41 42 43 44 45 46 47 48 49 50 |
# File 'lib/sink/resources/pagination_tests/offset.rb', line 41 def list_no_start_field(params = {}, opts = {}) req = { method: :get, path: "/paginated/offset/no_start_field", query: params, page: Sink::PageOffsetNoStartField, model: Sink::Models::MyModel } @client.request(req, opts) end |
#with_total_count(params = {}, opts = {}) ⇒ Sink::PageOffsetTotalCount<Sink::Models::MyModel>
Test case for offset pagination with a total count response property
61 62 63 64 65 66 67 68 69 70 |
# File 'lib/sink/resources/pagination_tests/offset.rb', line 61 def with_total_count(params = {}, opts = {}) req = { method: :get, path: "/paginated/offset/with_total_count", query: params, page: Sink::PageOffsetTotalCount, model: Sink::Models::MyModel } @client.request(req, opts) end |