Class: Fox::Canvas::ShapeGroup
- Inherits:
-
Object
- Object
- Fox::Canvas::ShapeGroup
- Includes:
- Enumerable
- Defined in:
- lib/fox16/canvas.rb
Instance Method Summary collapse
-
#addShape(shape) ⇒ Object
Add a shape to this group.
- #each ⇒ Object
-
#include?(shape) ⇒ Boolean
Does the group contain this shape?.
-
#initialize ⇒ ShapeGroup
constructor
Initialize this shape group.
-
#removeShape(shape) ⇒ Object
Remove a shape from this group.
- #reverse_each ⇒ Object
Constructor Details
permalink #initialize ⇒ ShapeGroup
Initialize this shape group
143 144 145 |
# File 'lib/fox16/canvas.rb', line 143 def initialize @shapes = [] end |
Instance Method Details
permalink #addShape(shape) ⇒ Object
Add a shape to this group
153 154 155 |
# File 'lib/fox16/canvas.rb', line 153 def addShape(shape) @shapes << shape end |
permalink #each ⇒ Object
[View source]
162 163 164 |
# File 'lib/fox16/canvas.rb', line 162 def each @shapes.each { |shape| yield shape } end |
permalink #include?(shape) ⇒ Boolean
Does the group contain this shape?
148 149 150 |
# File 'lib/fox16/canvas.rb', line 148 def include?(shape) @shapes.include?(shape) end |
permalink #removeShape(shape) ⇒ Object
Remove a shape from this group
158 159 160 |
# File 'lib/fox16/canvas.rb', line 158 def removeShape(shape) @shapes.remove(shape) end |
permalink #reverse_each ⇒ Object
[View source]
166 167 168 |
# File 'lib/fox16/canvas.rb', line 166 def reverse_each @shapes.reverse_each { |shape| yield shape } end |