Class: Katalyst::Tables::Collection::Pagination::Paginate
- Inherits:
-
Object
- Object
- Katalyst::Tables::Collection::Pagination::Paginate
- Defined in:
- app/models/concerns/katalyst/tables/collection/pagination.rb
Overview
:nodoc:
Instance Method Summary collapse
- #call(collection) ⇒ Object
-
#initialize(app) ⇒ Paginate
constructor
A new instance of Paginate.
-
#params ⇒ Object
pagy shim.
Constructor Details
#initialize(app) ⇒ Paginate
Returns a new instance of Paginate.
53 54 55 |
# File 'app/models/concerns/katalyst/tables/collection/pagination.rb', line 53 def initialize(app) @app = app end |
Instance Method Details
#call(collection) ⇒ Object
57 58 59 60 61 62 63 |
# File 'app/models/concerns/katalyst/tables/collection/pagination.rb', line 57 def call(collection) @collection = @app.call(collection) if collection.paginate? @collection.pagination, @collection.items = pagy(@collection.items, **collection.) end @collection end |
#params ⇒ Object
pagy shim
66 67 68 |
# File 'app/models/concerns/katalyst/tables/collection/pagination.rb', line 66 def params @collection.attributes.with_indifferent_access end |