Class: VectorSalad::StandardShapes::Rotate
- Inherits:
-
Transform
- Object
- Transform
- VectorSalad::StandardShapes::Rotate
- Defined in:
- lib/vector_salad/standard_shapes/rotate.rb
Overview
Rotates the contained shapes by the specified angle about the origin.
Instance Method Summary collapse
-
#initialize(angle, canvas:, **_options, &block) ⇒ Rotate
constructor
A new instance of Rotate.
Constructor Details
#initialize(angle, canvas:, **_options, &block) ⇒ Rotate
Returns a new instance of Rotate.
13 14 15 16 17 18 19 |
# File 'lib/vector_salad/standard_shapes/rotate.rb', line 13 def initialize(angle, canvas:, **, &block) instance_eval(&block) # inner_canvas is populated @canvas.each do |shape| canvas << shape.rotate(angle) end end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class VectorSalad::DSL