Class: DXF::LWPolyline

Inherits:
Entity
  • Object
show all
Defined in:
lib/dxf/entity.rb

Constant Summary

Constants inherited from Entity

Entity::TypeError

Instance Attribute Summary collapse

Attributes inherited from Entity

#handle, #layer

Instance Method Summary collapse

Methods inherited from Entity

new, #parse_pair

Methods included from ClusterFactory

included

Constructor Details

#initialize(*points) ⇒ LWPolyline

Returns a new instance of LWPolyline.



111
112
113
# File 'lib/dxf/entity.rb', line 111

def initialize(*points)
    @points = points.map {|a| Point[a]}
end

Instance Attribute Details

#pointsObject

Returns the value of attribute points.



109
110
111
# File 'lib/dxf/entity.rb', line 109

def points
  @points
end

Instance Method Details

#linesObject

Return the individual line segments



116
117
118
# File 'lib/dxf/entity.rb', line 116

def lines
    points.each_cons(2).map {|a,b| Line.new a, b}
end