Class: Layout::Layers
- Inherits:
-
Object
- Object
- Layout::Layers
- Includes:
- Enumerable
Overview
The Layers class is a container class for all layers in a Document.
Instance Method Summary # collapse
- #[](index) ⇒ Layout::Layer
- #active ⇒ Layout::Layer
- #active=(layer) ⇒ Object
- #add(*args) ⇒ Object
- #each {|layer| ... } ⇒ Object
- #index(layer) ⇒ Integer?
- #length ⇒ Integer (also: #size)
- #remove(*args) ⇒ Object
- #reorder(layer, new_index) ⇒ Object
Instance Method Details
↑ #[](index) ⇒ Layout::Layer
The #[] method returns a value from the array of Layout::Layers.
↑ #active ⇒ Layout::Layer
The #active method returns the active Layout::Layer in the Document.
↑ #active=(layer) ⇒ Layout::Layer #active=(index) ⇒ Layout::Layer
The #active= method sets the active Layout::Layer that will be displayed the next time the Document is opened. This value will change whenever the Layout::Layer is changed in the Document in LayOut.
↑ #add(shared = false) ⇒ Layout::Layer #add(name, shared = false) ⇒ Layout::Layer
The #add method adds a new Layout::Layer to the Document. The newly added Layout::Layer will be the last one in the Document.
↑ #each {|layer| ... } ⇒ 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::Layers.
↑ #index(layer) ⇒ Integer?
The #index method returns the index of the Layout::Layer, or nil
if it doesn't exist in the Document.
↑ #length ⇒ Integer Also known as: size
The #length method returns the number of Layout::Layers.
↑ #remove(layer, delete_entities = false) ⇒ Object #remove(index, delete_entities = false) ⇒ Object
The #remove method deletes the given Layout::Layer from the Document.
↑ #reorder(layer, new_index) ⇒ Object #reorder(index, new_index) ⇒ Object
The #reorder method moves a Layout::Layer to a different index within the Document's list of layers. This will move the Layout::Layer such that its new index becomes new_index.