Class: Rails::Contact::Search::Result
- Inherits:
-
Struct
- Object
- Struct
- Rails::Contact::Search::Result
- Defined in:
- lib/rails/contact/search/result.rb
Instance Attribute Summary collapse
-
#page ⇒ Object
Returns the value of attribute page.
-
#per_page ⇒ Object
Returns the value of attribute per_page.
-
#records ⇒ Object
Returns the value of attribute records.
-
#total_count ⇒ Object
Returns the value of attribute total_count.
Instance Method Summary collapse
Instance Attribute Details
#page ⇒ Object
Returns the value of attribute page
4 5 6 |
# File 'lib/rails/contact/search/result.rb', line 4 def page @page end |
#per_page ⇒ Object
Returns the value of attribute per_page
4 5 6 |
# File 'lib/rails/contact/search/result.rb', line 4 def per_page @per_page end |
#records ⇒ Object
Returns the value of attribute records
4 5 6 |
# File 'lib/rails/contact/search/result.rb', line 4 def records @records end |
#total_count ⇒ Object
Returns the value of attribute total_count
4 5 6 |
# File 'lib/rails/contact/search/result.rb', line 4 def total_count @total_count end |
Instance Method Details
#total_pages ⇒ Object
5 6 7 8 9 |
# File 'lib/rails/contact/search/result.rb', line 5 def total_pages return 0 if total_count.zero? || per_page.zero? (total_count.to_f / per_page).ceil end |