Class: CursorPaginator::Paginator::Dynamoid
- Defined in:
- lib/cursor_paginator/paginator/dynamoid.rb
Constant Summary
Constants inherited from Base
Instance Attribute Summary
Attributes inherited from Base
#options_parser, #paginator_options
Instance Method Summary collapse
Methods inherited from Base
Constructor Details
This class inherits a constructor from CursorPaginator::Paginator::Base
Instance Method Details
#paginate(scope) ⇒ Object
4 5 6 7 8 9 10 11 12 |
# File 'lib/cursor_paginator/paginator/dynamoid.rb', line 4 def paginate(scope) if .filter_required? cursor = scope.source.where(.fetch(:primary_key) => .cursor).first return PaginationResult.new([], self) if cursor.blank? end records = scope.record_limit(page_size + 1).start(cursor) PaginationResult.new(records, self) end |