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 71 def self.create Folio::BasicPage.new end
# File lib/folio/page.rb, line 34 def initialize @last_page = nil end
Public Instance Methods
# File lib/folio/page.rb, line 44 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 40 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 65 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