Class: SimplePolygons::Rectangle
- Defined in:
- lib/simple-polygons.rb
Overview
Represents a rectangle.
Direct Known Subclasses
Instance Method Summary collapse
-
#initialize(start_loc, length, width) ⇒ Rectangle
constructor
Makes a new rectangle with the specified boundaries.
Methods inherited from Polygon
Constructor Details
#initialize(start_loc, length, width) ⇒ Rectangle
Makes a new rectangle with the specified boundaries. start_loc should be a Location object and length and width parameters should be floats.
51 52 53 |
# File 'lib/simple-polygons.rb', line 51 def initialize(start_loc, length, width) super([start_loc, Location.new(start_loc.x() + length, start_loc.y() + width)]) end |