Class: VectorSalad::StandardShapes::Rotate

Inherits:
Transform
  • Object
show all
Defined in:
lib/vector_salad/standard_shapes/rotate.rb

Instance Method Summary collapse

Methods inherited from Transform

#canvas

Methods included from DSL

#method_missing

Constructor Details

#initialize(angle, canvas:, **_options, &block) ⇒ Rotate

Returns a new instance of Rotate.



15
16
17
18
19
20
21
# File 'lib/vector_salad/standard_shapes/rotate.rb', line 15

def initialize(angle, canvas:, **_options, &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