Class: CooCoo::DataSources::Xournal::Layer
- Defined in:
- lib/coo-coo/data_sources/xournal/document.rb
Instance Attribute Summary collapse
-
#children ⇒ Object
readonly
Returns the value of attribute children.
Instance Method Summary collapse
- #add_image(img) ⇒ Object
- #add_stroke(stroke) ⇒ Object
- #add_text(text) ⇒ Object
- #delete_child(child) ⇒ Object
- #delete_child_at(n) ⇒ Object
- #each(&block) ⇒ Object
- #each_image(&block) ⇒ Object
- #each_stroke(&block) ⇒ Object
- #each_text(&block) ⇒ Object
- #images ⇒ Object
-
#initialize ⇒ Layer
constructor
A new instance of Layer.
- #strokes ⇒ Object
- #text ⇒ Object
Constructor Details
Instance Attribute Details
#children ⇒ Object (readonly)
Returns the value of attribute children.
139 140 141 |
# File 'lib/coo-coo/data_sources/xournal/document.rb', line 139 def children @children end |
Instance Method Details
#add_image(img) ⇒ Object
185 186 187 |
# File 'lib/coo-coo/data_sources/xournal/document.rb', line 185 def add_image(img) @children << img end |
#add_stroke(stroke) ⇒ Object
159 160 161 162 |
# File 'lib/coo-coo/data_sources/xournal/document.rb', line 159 def add_stroke(stroke) @children << stroke self end |
#add_text(text) ⇒ Object
172 173 174 175 |
# File 'lib/coo-coo/data_sources/xournal/document.rb', line 172 def add_text(text) @children << text self end |
#delete_child(child) ⇒ Object
154 155 156 157 |
# File 'lib/coo-coo/data_sources/xournal/document.rb', line 154 def delete_child(child) @children.delete(child) self end |
#delete_child_at(n) ⇒ Object
149 150 151 152 |
# File 'lib/coo-coo/data_sources/xournal/document.rb', line 149 def delete_child_at(n) @children.delete_at(n) self end |
#each(&block) ⇒ Object
145 146 147 |
# File 'lib/coo-coo/data_sources/xournal/document.rb', line 145 def each(&block) @children.each(&block) end |
#each_image(&block) ⇒ Object
193 194 195 |
# File 'lib/coo-coo/data_sources/xournal/document.rb', line 193 def each_image(&block) images.each(&block) end |
#each_stroke(&block) ⇒ Object
168 169 170 |
# File 'lib/coo-coo/data_sources/xournal/document.rb', line 168 def each_stroke(&block) strokes.each(&block) end |
#each_text(&block) ⇒ Object
181 182 183 |
# File 'lib/coo-coo/data_sources/xournal/document.rb', line 181 def each_text(&block) text.each(&block) end |
#images ⇒ Object
189 190 191 |
# File 'lib/coo-coo/data_sources/xournal/document.rb', line 189 def images @children.select { |c| c.kind_of?(Image) } end |