Class: VectorSalad::StandardShapes::Square

Inherits:
Rect show all
Defined in:
lib/vector_salad/standard_shapes/square.rb

Overview

Square shape with equal width and height.

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (Square) initialize(size, **options)

Create a square with equal width and height.

Examples:

Square with sides 100x100

new(100)

Parameters:

  • size (Pos)
  • options ({})

    +{}+



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

def initialize(size, **options)
  super(size, size, **options)
  self
end

Instance Attribute Details

- (Object) height (readonly) Originally defined in class Rect

Returns the value of attribute height

- (Object) options Originally defined in class BasicShape

Returns the value of attribute options

- (Object) width (readonly) Originally defined in class Rect

Returns the value of attribute width