class Straightedge::Figures::Quadrilateral

Attributes

dimensions[R]

Public Class Methods

new(dimensions: [1,1], location: ORIGIN, color: :white) click to toggle source
Calls superclass method Straightedge::Figures::Figure::new
# File lib/straightedge/figures/quadrilateral.rb, line 8
def initialize(dimensions: [1,1], location: ORIGIN, color: :white)
  super([], location: location, color: color)
  @dimensions = dimensions
  @marks      = corners
end

Public Instance Methods

corners(w=width, h=height) click to toggle source
# File lib/straightedge/figures/quadrilateral.rb, line 14
def corners(w=width, h=height)
  @corners ||= [[x,y],[x,y+h],[x+w,y+h],[x+w,y]]
end