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
15 16 17 |
# File 'lib/europeana/blacklight/response/pagination.rb', line 15 def limit_value rows end |
#max_pages(val = :none) ⇒ Object
32 33 34 35 36 37 38 39 40 |
# File 'lib/europeana/blacklight/response/pagination.rb', line 32 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
27 28 29 30 |
# File 'lib/europeana/blacklight/response/pagination.rb', line 27 def model_name return unless docs.present? && docs.first.respond_to?(:model_name) docs.first.model_name end |
#next_page ⇒ Object
47 48 49 |
# File 'lib/europeana/blacklight/response/pagination.rb', line 47 def next_page current_page + 1 unless last_page? end |
#offset_value ⇒ Object
19 20 21 |
# File 'lib/europeana/blacklight/response/pagination.rb', line 19 def offset_value start end |
#prev_page ⇒ Object
51 52 53 |
# File 'lib/europeana/blacklight/response/pagination.rb', line 51 def prev_page current_page - 1 unless first_page? end |
#total_count ⇒ Object
23 24 25 |
# File 'lib/europeana/blacklight/response/pagination.rb', line 23 def total_count total end |
#total_pages ⇒ Object
42 43 44 45 |
# File 'lib/europeana/blacklight/response/pagination.rb', line 42 def total_pages total = super total > max_pages ? max_pages : total end |