Class: Layout::Pages
- Inherits:
-
Object
- Object
- Layout::Pages
- Includes:
- Enumerable
Overview
The Pages class is a container class for all pages in a Document.
Instance Method Summary # collapse
- #[](index) ⇒ Layout::Page
- #add(name = nil) ⇒ Layout::Page
- #each {|page| ... } ⇒ Object
- #index(page) ⇒ Integer?
- #initial ⇒ Layout::Page
- #initial=(page) ⇒ Object
- #length ⇒ Integer (also: #size)
- #remove(page) ⇒ Object
- #reorder(page, new_index) ⇒ Object
Instance Method Details
↑ #[](index) ⇒ Layout::Page
The #[] method returns a value from the array of Layout::Pages.
↑ #add(name = nil) ⇒ Layout::Page
The #add method adds a new Layout::Page to the Document. The newly added Layout::Page will be the last one in the Document.
↑ #each {|page| ... } ⇒ Object
Don't remove content from this collection while iterating over it with #each. This would change the size of the collection and cause elements to be skipped as the indices change. Instead copy the current collection to an array using to_a
and then use each
on the array, when removing content.
The #each method iterates through all of the Layout::Pages.
↑ #index(page) ⇒ Integer?
The #index method returns the index of the Layout::Page, or nil
if it doesn't exist in the Document.
↑ #initial ⇒ Layout::Page
The #initial method returns the initial Layout::Page that will be displayed the next time the Document is opened. This value will change whenever the Layout::Page is changed in the Document in LayOut.
↑ #initial=(page) ⇒ Object #initial=(index) ⇒ Object
The #initial= method sets the initial Layout::Page that will be displayed the next time the Document is opened. This value will change whenever the Layout::Page is changed in the Document in LayOut.
↑ #length ⇒ Integer Also known as: size
The #length method returns the number of Layout::Pages.
↑ #remove(page) ⇒ Object #remove(index) ⇒ Object
The #remove method deletes the given Layout::Page from the Document.
↑ #reorder(page, new_index) ⇒ Object #reorder(index, new_index) ⇒ Object
The #reorder method moves a Layout::Page to a different index within the Document's list of pages. This will move the Layout::Page such that its new index becomes new_index.