Class: Typesense::Pagination::WillPaginate

Inherits:
Object
  • Object
show all
Defined in:
lib/typesense/pagination/will_paginate.rb

Class Method Summary collapse

Class Method Details

.create(results, total_hits, options = {}) ⇒ Object



10
11
12
13
14
# File 'lib/typesense/pagination/will_paginate.rb', line 10

def self.create(results, total_hits, options = {})
  ::WillPaginate::Collection.create(options[:page], options[:per_page], total_hits) do |pager|
    pager.replace results
  end
end