class SRL::ResultSet
Wrapper around various calls to paginated data, such as past races. Contains pagination information, and information on all records, on top of the current page's records.
Attributes
Total number of records matching the query for this result set.
Records for this result set.
- NOTE
-
Always an array, though the type of object contained in the array can vary depending on the query that spawned it.
Records for this result set.
- NOTE
-
Always an array, though the type of object contained in the array can vary depending on the query that spawned it.
Total number of records matching the query for this result set.
The page of this result set.
Records for this result set.
- NOTE
-
Always an array, though the type of object contained in the array can vary depending on the query that spawned it.
Records for this result set.
- NOTE
-
Always an array, though the type of object contained in the array can vary depending on the query that spawned it.
Total number of records matching the query for this result set.
Public Class Methods
# File lib/srl/result_set.rb, line 26 def initialize(results, params = {}) @results = results @page = params.fetch(:page) @page_size = params.fetch(:page_size) @count = params.fetch(:count) end
Public Instance Methods
# File lib/srl/result_set.rb, line 38 def last_page? page == num_pages end
# File lib/srl/result_set.rb, line 33 def num_pages (count.to_f / page_size.to_f).ceil end