lib/pagy/extras/array.rb in pagy-0.8.6 vs lib/pagy/extras/array.rb in pagy-0.9.0

- old
+ new

@@ -1,18 +1,18 @@ -# See the Pagy Extras documentation: https://ddnexus.github.io/pagy/extras +# See the Pagy documentation: https://ddnexus.github.io/pagy/extras/array class Pagy # Add specialized backend methods to paginate array collections module Backend ; private - # return pagy object and items + # Return Pagy object and items def pagy_array(array, vars={}) pagy = Pagy.new(pagy_array_get_vars(array, vars)) return pagy, array[pagy.offset, pagy.items] end def pagy_array_get_vars(array, vars) - # return the merged variables to initialize the pagy object + # Return the merged variables to initialize the Pagy object { count: array.count, page: params[vars[:page_param]||VARS[:page_param]] }.merge!(vars) end end