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.



227
228
229
230
# File 'lib/rcad.rb', line 227

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.



225
226
227
# File 'lib/rcad.rb', line 225

def paths
  @paths
end

#pointsObject (readonly)

Returns the value of attribute points.



225
226
227
# File 'lib/rcad.rb', line 225

def points
  @points
end