Class: Rails::Contact::Search::Result

Inherits:
Struct
  • Object
show all
Defined in:
lib/rails/contact/search/result.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#pageObject

Returns the value of attribute page

Returns:

  • (Object)

    the current value of page



4
5
6
# File 'lib/rails/contact/search/result.rb', line 4

def page
  @page
end

#per_pageObject

Returns the value of attribute per_page

Returns:

  • (Object)

    the current value of per_page



4
5
6
# File 'lib/rails/contact/search/result.rb', line 4

def per_page
  @per_page
end

#recordsObject

Returns the value of attribute records

Returns:

  • (Object)

    the current value of records



4
5
6
# File 'lib/rails/contact/search/result.rb', line 4

def records
  @records
end

#total_countObject

Returns the value of attribute total_count

Returns:

  • (Object)

    the current value of total_count



4
5
6
# File 'lib/rails/contact/search/result.rb', line 4

def total_count
  @total_count
end

Instance Method Details

#total_pagesObject



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