Module: Europeana::Blacklight::Response::Pagination
- Extended by:
- ActiveSupport::Concern
- Includes:
- Kaminari::ConfigurationMethods::ClassMethods, Kaminari::PageScopeMethods
- Included in:
- Europeana::Blacklight::Response
- Defined in:
- lib/europeana/blacklight/response/pagination.rb
Overview
Pagination forEuropeana::Blacklight::Response
Based on Blacklight::SolrResponse::Pagination v5.10.2
Instance Method Summary collapse
- #limit_value ⇒ Object
- #max_pages(val = :none) ⇒ Object
- #model_name ⇒ Object
- #next_page ⇒ Object
- #offset_value ⇒ Object
- #prev_page ⇒ Object
- #total_count ⇒ Object
- #total_pages ⇒ Object
Instance Method Details
#limit_value ⇒ Object
17 18 19 |
# File 'lib/europeana/blacklight/response/pagination.rb', line 17 def limit_value rows end |
#max_pages(val = :none) ⇒ Object
34 35 36 37 38 39 40 41 42 |
# File 'lib/europeana/blacklight/response/pagination.rb', line 34 def max_pages(val = :none) if val == :none # getter (defined?(@_max_pages) && @_max_pages) || (1000 / limit_value) else # setter @_max_pages = val end end |
#model_name ⇒ Object
29 30 31 32 |
# File 'lib/europeana/blacklight/response/pagination.rb', line 29 def model_name return unless docs.present? && docs.first.respond_to?(:model_name) docs.first.model_name end |
#next_page ⇒ Object
49 50 51 |
# File 'lib/europeana/blacklight/response/pagination.rb', line 49 def next_page current_page + 1 unless last_page? end |
#offset_value ⇒ Object
21 22 23 |
# File 'lib/europeana/blacklight/response/pagination.rb', line 21 def offset_value start end |
#prev_page ⇒ Object
53 54 55 |
# File 'lib/europeana/blacklight/response/pagination.rb', line 53 def prev_page current_page - 1 unless first_page? end |
#total_count ⇒ Object
25 26 27 |
# File 'lib/europeana/blacklight/response/pagination.rb', line 25 def total_count total end |
#total_pages ⇒ Object
44 45 46 47 |
# File 'lib/europeana/blacklight/response/pagination.rb', line 44 def total_pages total = super total > max_pages ? max_pages : total end |