Sha256: 28b31f0a5ea344d179e4250c7f8ac1b7ae6d8e60897c4aa73ae8150773c82dc1
Contents?: true
Size: 481 Bytes
Versions: 1
Compression:
Stored size: 481 Bytes
Contents
module Straightedge module Figures class Quadrilateral < Figure attr_reader :dimensions def_delegator :dimensions, :x, :width def_delegator :dimensions, :y, :height def initialize(dimensions: [1,1], location: ORIGIN, color: :white) super([], location: location, color: color) @dimensions = dimensions @marks = corners end def corners(w=width, h=height) @corners ||= [[x,y],[x,y+h],[x+w,y+h],[x+w,y]] end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
straightedge-0.1.2 | lib/straightedge/figures/quadrilateral.rb |