Class: VectorSalad::StandardShapes::BasicShape

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Includes:
Contracts::Core
Defined in:
lib/vector_salad/standard_shapes/basic_shape.rb,
lib/vector_salad/exporters/svg_exporter.rb

Overview

All shapes must inherit from BasicShape, with the exception of N node. It alows many usefulmethods in Path to be called on the shape by delegating them, so see Path for more information on all the methods that shapes can use.

You can't use BasicShape directly.

Direct Known Subclasses

Circle, Clip, Custom, Group, Heart, IsoTri, MultiPath, Oval, Path, Polygon, Rect

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Instance Attribute Details

- (Object) options

Returns the value of attribute options



19
20
21
# File 'lib/vector_salad/standard_shapes/basic_shape.rb', line 19

def options
  @options
end

Instance Method Details

- (Object) flip

See Also:



24
# File 'lib/vector_salad/standard_shapes/basic_shape.rb', line 24

def_instance_delegator :to_path, :flip

- (Object) flip_x

See Also:



25
# File 'lib/vector_salad/standard_shapes/basic_shape.rb', line 25

def_instance_delegator :to_path, :flip_x

- (Object) flip_y

See Also:



26
# File 'lib/vector_salad/standard_shapes/basic_shape.rb', line 26

def_instance_delegator :to_path, :flip_y

- (Object) jitter

See Also:



30
# File 'lib/vector_salad/standard_shapes/basic_shape.rb', line 30

def_instance_delegator :to_path, :jitter

- (Object) move

See Also:



29
# File 'lib/vector_salad/standard_shapes/basic_shape.rb', line 29

def_instance_delegator :to_path, :move

- (Object) rotate

See Also:



27
# File 'lib/vector_salad/standard_shapes/basic_shape.rb', line 27

def_instance_delegator :to_path, :rotate

- (Object) scale

See Also:



31
# File 'lib/vector_salad/standard_shapes/basic_shape.rb', line 31

def_instance_delegator :to_path, :scale

- (Object) to_a

See Also:



36
# File 'lib/vector_salad/standard_shapes/basic_shape.rb', line 36

def_instance_delegator :to_path, :to_a

- (Object) to_bezier_path



33
# File 'lib/vector_salad/standard_shapes/basic_shape.rb', line 33

def_instance_delegator :to_path, :to_bezier_path

- (Object) to_cubic_path

See Also:



34
# File 'lib/vector_salad/standard_shapes/basic_shape.rb', line 34

def_instance_delegator :to_path, :to_cubic_path

- (Object) to_multi_path

See Also:



35
# File 'lib/vector_salad/standard_shapes/basic_shape.rb', line 35

def_instance_delegator :to_path, :to_multi_path

- (Object) to_path(:[])

See Also:

  • Path#:[]


28
# File 'lib/vector_salad/standard_shapes/basic_shape.rb', line 28

def_instance_delegator :to_path, :[]

- (Object) to_simple_path



32
# File 'lib/vector_salad/standard_shapes/basic_shape.rb', line 32

def_instance_delegator :to_path, :to_simple_path

- (Object) to_svg

Export the shape to an svg string



82
83
84
# File 'lib/vector_salad/exporters/svg_exporter.rb', line 82

def to_svg
  to_path.to_svg
end