Class: Layout::Pages
- Inherits:
-
Object
- Object
- Layout::Pages
- Includes:
- Enumerable
- Defined in:
- lib/sketchup-api-stubs/stubs/Layout/Pages.rb
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.
39 40 |
# File 'lib/sketchup-api-stubs/stubs/Layout/Pages.rb', line 39 def [](index) end |
#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.
56 57 |
# File 'lib/sketchup-api-stubs/stubs/Layout/Pages.rb', line 56 def add(name = nil) end |
#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.
76 77 |
# File 'lib/sketchup-api-stubs/stubs/Layout/Pages.rb', line 76 def each end |
#index(page) ⇒ Integer?
The #index method returns the index of the Layout::Page, or nil
if it doesn’t exist in the Document.
92 93 |
# File 'lib/sketchup-api-stubs/stubs/Layout/Pages.rb', line 92 def index(page) end |
#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.
108 109 |
# File 'lib/sketchup-api-stubs/stubs/Layout/Pages.rb', line 108 def initial end |
#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.
135 136 |
# File 'lib/sketchup-api-stubs/stubs/Layout/Pages.rb', line 135 def initial=(page) end |
#length ⇒ Integer Also known as: size
The #length method returns the number of Layout::Pages.
148 149 |
# File 'lib/sketchup-api-stubs/stubs/Layout/Pages.rb', line 148 def length end |
#remove(page) ⇒ Object #remove(index) ⇒ Object
The #remove method deletes the given Layout::Page from the Document.
178 179 |
# File 'lib/sketchup-api-stubs/stubs/Layout/Pages.rb', line 178 def remove(page) end |
#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.
206 207 |
# File 'lib/sketchup-api-stubs/stubs/Layout/Pages.rb', line 206 def reorder(page, new_index) end |