Class: Geometry::SizedSquare

Inherits:
Square
  • Object
show all
Defined in:
lib/aurora-geometry/square.rb

Overview

A Square created with an origin point and a size

Instance Attribute Summary

Attributes inherited from Square

#origin

Instance Method Summary collapse

Methods inherited from Square

#height, #width

Constructor Details

#initialize(origin, size) ⇒ SizedSquare

Returns a new instance of SizedSquare.

Parameters:

  • origin (Point)

    The origin point (bottom-left corner)

  • size (Numeric)

    The length of each side



108
109
110
111
# File 'lib/aurora-geometry/square.rb', line 108

def initialize(origin, size)
    @origin = Point[origin]
    @size = size
end