Class: Polygon

Inherits:
Object
  • Object
show all
Defined in:
lib/rcad.rb

Direct Known Subclasses

RegularPolygon, Square

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(points, paths = nil) ⇒ Polygon

Returns a new instance of Polygon.



215
216
217
218
# File 'lib/rcad.rb', line 215

def initialize(points, paths=nil)
  @points = points
  @paths = paths || [(0...points.size).to_a]
end

Instance Attribute Details

#pathsObject (readonly)

Returns the value of attribute paths.



213
214
215
# File 'lib/rcad.rb', line 213

def paths
  @paths
end

#pointsObject (readonly)

Returns the value of attribute points.



213
214
215
# File 'lib/rcad.rb', line 213

def points
  @points
end