Class: Sink::Resources::PaginationTests::Cursor
- Inherits:
-
Object
- Object
- Sink::Resources::PaginationTests::Cursor
- Defined in:
- lib/sink/resources/pagination_tests/cursor.rb
Instance Method Summary collapse
-
#initialize(client:) ⇒ Cursor
constructor
A new instance of Cursor.
-
#list(params = {}, opts = {}) ⇒ Sink::PageCursor<Sink::Models::MyModel>
Test case for cursor pagination.
-
#list_reverse(params = {}, opts = {}) ⇒ Sink::PageCursorWithReverse<Sink::Models::MyModel>
Test case for cursor pagination with reverse support.
Constructor Details
#initialize(client:) ⇒ Cursor
Returns a new instance of Cursor.
8 9 10 |
# File 'lib/sink/resources/pagination_tests/cursor.rb', line 8 def initialize(client:) @client = client end |
Instance Method Details
#list(params = {}, opts = {}) ⇒ Sink::PageCursor<Sink::Models::MyModel>
Test case for cursor pagination
21 22 23 24 25 26 27 28 29 30 |
# File 'lib/sink/resources/pagination_tests/cursor.rb', line 21 def list(params = {}, opts = {}) req = { method: :get, path: "/paginated/cursor", query: params, page: Sink::PageCursor, model: Sink::Models::MyModel } @client.request(req, opts) end |
#list_reverse(params = {}, opts = {}) ⇒ Sink::PageCursorWithReverse<Sink::Models::MyModel>
Test case for cursor pagination with reverse support
44 45 46 47 48 49 50 51 52 53 |
# File 'lib/sink/resources/pagination_tests/cursor.rb', line 44 def list_reverse(params = {}, opts = {}) req = { method: :get, path: "/paginated/cursor_with_reverse", query: params, page: Sink::PageCursorWithReverse, model: Sink::Models::MyModel } @client.request(req, opts) end |