Class: LHS::Pagination::TotalPages

Inherits:
Page
  • Object
show all
Defined in:
lib/lhs/pagination/total_pages.rb

Constant Summary

Constants inherited from Page

Page::DEFAULT_OFFSET

Constants inherited from Base

Base::DEFAULT_LIMIT

Instance Attribute Summary

Attributes inherited from Base

#data

Instance Method Summary collapse

Methods inherited from Page

#current_page, #next_offset, next_offset

Methods inherited from Base

#current_page, #first_page, #initialize, #last_page, #limit, #limit_value, #next?, #next_offset, #next_page, #offset, page_to_offset, #pages_left, #pages_left?, #parallel?, #prev_page, #previous?, #total_pages

Constructor Details

This class inherits a constructor from LHS::Pagination::Base

Instance Method Details

#totalObject Also known as: count



5
6
7
# File 'lib/lhs/pagination/total_pages.rb', line 5

def total
  (data._raw.dig(*_record.total_key) || 0) * limit
end