module Folio::Page

Attributes

current_page[RW]

page identifier addressing this page within the folio.

first_page[RW]

page identifier addressing the first page within the folio.

next_page[RW]

page identifier addressing the immediately following page within the folio, if there is one.

ordinal_pages[RW]

indicates whether the page identifiers in current_page, first_page, last_page, previous_page, and next_page should be considered ordinal or not.

ordinal_pages?[RW]

indicates whether the page identifiers in current_page, first_page, last_page, previous_page, and next_page should be considered ordinal or not.

previous_page[RW]

page identifier addressing the immediately preceding page within the folio, if there is one and it is known.

total_entries[RW]

number of items in the folio, if known.

Public Class Methods

create() click to toggle source
# File lib/folio/page.rb, line 67
def self.create
  Folio::BasicPage.new
end

Public Instance Methods

last_page() click to toggle source
# File lib/folio/page.rb, line 40
def last_page
  if next_page.nil?
    current_page
  else
    @last_page
  end
end
last_page=(value) click to toggle source

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
total_pages() click to toggle source

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