Class: Geometry::SizedSquare

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

Overview

A Square created with an origin point and a size

Instance Attribute Summary

Attributes inherited from Square

#options, #origin

Instance Method Summary collapse

Methods inherited from Square

#height, #width

Constructor Details

#initialize(origin, size) ⇒ SizedSquare

Returns a new instance of SizedSquare.

Parameters:

  • The origin point (bottom-left corner)

  • The length of each side



112
113
114
115
# File 'lib/geometry/square.rb', line 112

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