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
#initialize ⇒ ShapeGroup
Initialize this shape group
150 151 152 |
# File 'lib/fox16/canvas.rb', line 150 def initialize @shapes = [] end |
Instance Method Details
#addShape(shape) ⇒ Object
Add a shape to this group
160 161 162 |
# File 'lib/fox16/canvas.rb', line 160 def addShape(shape) @shapes << shape end |
#each ⇒ Object
169 170 171 |
# File 'lib/fox16/canvas.rb', line 169 def each @shapes.each { |shape| yield shape } end |
#include?(shape) ⇒ Boolean
Does the group contain this shape?
155 156 157 |
# File 'lib/fox16/canvas.rb', line 155 def include?(shape) @shapes.include?(shape) end |
#removeShape(shape) ⇒ Object
Remove a shape from this group
165 166 167 |
# File 'lib/fox16/canvas.rb', line 165 def removeShape(shape) @shapes.remove(shape) end |
#reverse_each ⇒ Object
173 174 175 |
# File 'lib/fox16/canvas.rb', line 173 def reverse_each @shapes.reverse_each { |shape| yield shape } end |