A response module which gets mixed into the solr ["response"] array.
Returns the current page calculated from 'rows' and 'start' WillPaginate hook
# File lib/rsolr/pagination.rb, line 88 def current_page return 1 if start < 1 per_page_normalized = per_page < 1 ? 1 : per_page @current_page ||= (start / per_page_normalized).ceil + 1 end
# File lib/rsolr/pagination.rb, line 112 def has_next? current_page < total_pages end
# File lib/rsolr/pagination.rb, line 116 def has_previous? current_page > 1 end
returns the next page number or the last WillPaginate hook
# File lib/rsolr/pagination.rb, line 108 def next_page @next_page ||= (current_page == total_pages) ? total_pages : current_page+1 end
Generated with the Darkfish Rdoc Generator 2.