Module: Ansr::Blacklight::Solr::Response::PaginationMethods

Includes:
Kaminari::ConfigurationMethods::ClassMethods, Kaminari::PageScopeMethods
Included in:
Ansr::Blacklight::Solr::Response, Group, GroupResponse
Defined in:
lib/ansr_blacklight/solr/response/pagination_methods.rb

Instance Method Summary collapse

Instance Method Details

#limit_valueObject

:nodoc:



7
8
9
# File 'lib/ansr_blacklight/solr/response/pagination_methods.rb', line 7

def limit_value #:nodoc:
  rows
end

#model_nameObject



19
20
21
22
23
# File 'lib/ansr_blacklight/solr/response/pagination_methods.rb', line 19

def model_name
  if !docs.empty? and docs.first.respond_to? :model_name
    docs.first.model_name
  end
end

#next_pageObject

Methods in kaminari master that we’d like to use today. Next page number in the collection



27
28
29
# File 'lib/ansr_blacklight/solr/response/pagination_methods.rb', line 27

def next_page
current_page + 1 unless last_page?
end

#offset_valueObject

:nodoc:



11
12
13
# File 'lib/ansr_blacklight/solr/response/pagination_methods.rb', line 11

def offset_value #:nodoc:
  start
end

#prev_pageObject

Previous page number in the collection



32
33
34
# File 'lib/ansr_blacklight/solr/response/pagination_methods.rb', line 32

def prev_page
  current_page - 1 unless first_page?
end

#total_countObject

:nodoc:



15
16
17
# File 'lib/ansr_blacklight/solr/response/pagination_methods.rb', line 15

def total_count #:nodoc:
  total
end