Class: Sunspot::Search::AbstractSearch
- Inherits:
-
Object
- Object
- Sunspot::Search::AbstractSearch
- Defined in:
- lib/sunspot_with_kaminari.rb
Instance Method Summary collapse
- #any? ⇒ Boolean
-
#current_page ⇒ Object
Returns.
- #empty? ⇒ Boolean
-
#limit_value ⇒ Object
Returns.
-
#num_pages ⇒ Object
Returns.
Instance Method Details
#any? ⇒ Boolean
36 37 38 |
# File 'lib/sunspot_with_kaminari.rb', line 36 def any? total > 0 end |
#current_page ⇒ Object
Returns
- Integer
-
Current page number
12 13 14 |
# File 'lib/sunspot_with_kaminari.rb', line 12 def current_page @query.page end |
#empty? ⇒ Boolean
32 33 34 |
# File 'lib/sunspot_with_kaminari.rb', line 32 def empty? total == 0 end |
#limit_value ⇒ Object
Returns
- Integer
-
Number of records displayed per page
28 29 30 |
# File 'lib/sunspot_with_kaminari.rb', line 28 def limit_value @query.per_page end |
#num_pages ⇒ Object
Returns
- Integer
-
Total number of pages for matching documents
20 21 22 |
# File 'lib/sunspot_with_kaminari.rb', line 20 def num_pages (total.to_f / @query.per_page).ceil end |