Class: DXF::Line
Constant Summary
Constants inherited from Entity
Instance Attribute Summary collapse
- #first ⇒ Object readonly
- #last ⇒ Object readonly
-
#x1 ⇒ Object
Returns the value of attribute x1.
-
#x2 ⇒ Object
Returns the value of attribute x2.
-
#y1 ⇒ Object
Returns the value of attribute y1.
-
#y2 ⇒ Object
Returns the value of attribute y2.
-
#z1 ⇒ Object
Returns the value of attribute z1.
-
#z2 ⇒ Object
Returns the value of attribute z2.
Attributes inherited from Entity
Instance Method Summary collapse
Methods inherited from Entity
Methods included from ClusterFactory
Instance Attribute Details
#first ⇒ Object (readonly)
87 88 89 |
# File 'lib/dxf/entity.rb', line 87 def first point_from_values x1, y1, z1 end |
#last ⇒ Object (readonly)
93 94 95 |
# File 'lib/dxf/entity.rb', line 93 def last point_from_values x2, y2, z2 end |
#x1 ⇒ Object
Returns the value of attribute x1.
69 70 71 |
# File 'lib/dxf/entity.rb', line 69 def x1 @x1 end |
#x2 ⇒ Object
Returns the value of attribute x2.
70 71 72 |
# File 'lib/dxf/entity.rb', line 70 def x2 @x2 end |
#y1 ⇒ Object
Returns the value of attribute y1.
69 70 71 |
# File 'lib/dxf/entity.rb', line 69 def y1 @y1 end |
#y2 ⇒ Object
Returns the value of attribute y2.
70 71 72 |
# File 'lib/dxf/entity.rb', line 70 def y2 @y2 end |
#z1 ⇒ Object
Returns the value of attribute z1.
69 70 71 |
# File 'lib/dxf/entity.rb', line 69 def z1 @z1 end |
#z2 ⇒ Object
Returns the value of attribute z2.
70 71 72 |
# File 'lib/dxf/entity.rb', line 70 def z2 @z2 end |
Instance Method Details
#parse_pair(code, value) ⇒ Object
72 73 74 75 76 77 78 79 80 81 82 83 |
# File 'lib/dxf/entity.rb', line 72 def parse_pair(code, value) case code when '10' then self.x1 = value.to_f when '20' then self.y1 = value.to_f when '30' then self.z1 = value.to_f when '11' then self.x2 = value.to_f when '21' then self.y2 = value.to_f when '31' then self.z2 = value.to_f else super # Handle common and unrecognized codes end end |