Module: PactBroker::Api::Resources::PaginationMethods
- Included in:
- BranchVersions, Dashboard, Integrations, Labels, PacticipantBranches, Pacticipants, Versions
- Defined in:
- lib/pact_broker/api/resources/pagination_methods.rb
Instance Method Summary collapse
- #default_pagination_options ⇒ Object
-
#pagination_options ⇒ Object
rubocop: disable Metrics/CyclomaticComplexity.
Instance Method Details
#default_pagination_options ⇒ Object
22 23 24 |
# File 'lib/pact_broker/api/resources/pagination_methods.rb', line 22 def { page_number: 1, page_size: 100 } end |
#pagination_options ⇒ Object
rubocop: disable Metrics/CyclomaticComplexity
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/pact_broker/api/resources/pagination_methods.rb', line 6 def if request.query["page"] || request.query["size"] { page_number: request.query["page"]&.to_i || 1, page_size: request.query["size"]&.to_i || 100 } elsif request.query["pageNumber"] || request.query["pageSize"] { page_number: request.query["pageNumber"]&.to_i || 1, page_size: request.query["pageSize"]&.to_i || 100 } else {} end end |