Class: VectorSalad::StandardShapes::Group

Inherits:
BasicShape
  • Object
show all
Includes:
Mixins::Transforms, VectorSalad::StandardShapes
Defined in:
lib/vector_salad/standard_shapes/group.rb

Overview

Group the contained shapes.

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (Group) initialize(**_options, &block)

Returns a new instance of Group



15
16
17
# File 'lib/vector_salad/standard_shapes/group.rb', line 15

def initialize(**_options, &block)
  instance_eval(&block) if block # inner_canvas is populated
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class VectorSalad::DSL

Instance Attribute Details

- (Object) canvas

Returns the value of attribute canvas



13
14
15
# File 'lib/vector_salad/standard_shapes/group.rb', line 13

def canvas
  @canvas
end

- (Object) options Originally defined in class BasicShape

Returns the value of attribute options

Instance Method Details

- (Any) [](x, y) Originally defined in module Mixins::Transforms

Move the shape absolutely.

Parameters:

  • x (Num)
  • y (Num)

Returns:

  • (Any)

- (Any) move(x, y) Originally defined in module Mixins::Transforms

Move the shape relatively.

Parameters:

  • x (Num)
  • y (Num)

Returns:

  • (Any)

- (Any) rotate(angle) Originally defined in module Mixins::Transforms

Rotates the shape by the specified angle about the origin.

Parameters:

  • angle (Num)

Returns:

  • (Any)

- (Any) scale(multiplier) Originally defined in module Mixins::Transforms

Scale a shape by multiplier about the origin.

Parameters:

  • multiplier (Num)

Returns:

  • (Any)

- (Object) to_path

Returns self



24
25
26
# File 'lib/vector_salad/standard_shapes/group.rb', line 24

def to_path
  self
end