Class: Layout::Pages
Relationships | |
Super Chains via Extension / Inclusion / Inheritance | |
Instance Chain:
self,
Enumerable
|
|
Inherits: | Object |
Overview
The Pages class is a container class for all pages in a Document
.
Instance Attribute Summary
Instance Method Summary
Instance Attribute Details
#initial ⇒ Layout::Page (rw)
#initial=(page) (rw)
#initial=(index)
Instance Method Details
#[](index) ⇒ Layout::Page
The #[]
method returns a value from the array of Page
s.
#add(name = nil) ⇒ Layout::Page
#each {|page| ... }
Note:
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 Page
s.
#index(page) ⇒ Integer
?
#length ⇒ Integer
Also known as: #size
The #length
method returns the number of Page
s.
#remove(page)
#remove(index)
#reorder(page, new_index)
#reorder(index, new_index)
#size
Alias for #length.