module Folio::Page
Attributes
page identifier addressing this page within the folio.
page identifier addressing the first page within the folio.
page identifier addressing the immediately following page within the folio, if there is one.
indicates whether the page identifiers in current_page
, first_page
, last_page
, previous_page
, and next_page
should be considered ordinal or not.
indicates whether the page identifiers in current_page
, first_page
, last_page
, previous_page
, and next_page
should be considered ordinal or not.
page identifier addressing the immediately preceding page within the folio, if there is one and it is known.
number of items in the folio, if known.
Public Class Methods
# File lib/folio/page.rb, line 67 def self.create Folio::BasicPage.new end
Public Instance Methods
# File lib/folio/page.rb, line 40 def last_page if next_page.nil? current_page else @last_page end end
page identifier addressing the final page within the folio, if known.
# File lib/folio/page.rb, line 36 def last_page=(value) @last_page = value end
number of pages in the folio, if known. calculated from total_entries
and per_page.
# File lib/folio/page.rb, line 61 def total_pages return nil unless total_entries && per_page && per_page > 0 return 1 if total_entries <= 0 (total_entries / per_page.to_f).ceil end