Module: Pagy::Searcher
- Defined in:
- lib/pagy/modules/searcher.rb
Overview
Relegate internal functions. Make overriding search classes easier.
Class Method Summary collapse
-
.wrap(pagy_search_args, options) ⇒ Object
Common search logic.
Class Method Details
.wrap(pagy_search_args, options) ⇒ Object
Common search logic
9 10 11 12 13 14 15 |
# File 'lib/pagy/modules/searcher.rb', line 9 def wrap(pagy_search_args, ) [:page] ||= [:request].resolve_page [:limit] = [:request].resolve_limit pagy, results = yield calling = pagy_search_args[4..] [pagy, calling.empty? ? results : results.send(*calling)] end |