Class: Geometry::TwoPointLine
Instance Attribute Summary collapse
-
#first ⇒ Object
readonly
Returns the value of attribute first.
-
#last ⇒ Object
readonly
Returns the value of attribute last.
Instance Method Summary collapse
-
#initialize(point0, point1) ⇒ TwoPointLine
constructor
A new instance of TwoPointLine.
- #inspect ⇒ Object (also: #to_s)
Methods inherited from Line
[], horizontal, new, vertical
Methods included from ClusterFactory
Constructor Details
#initialize(point0, point1) ⇒ TwoPointLine
Returns a new instance of TwoPointLine.
134 135 136 |
# File 'lib/geometry/line.rb', line 134 def initialize(point0, point1) @first, @last = [Point[point0], Point[point1]] end |
Instance Attribute Details
#first ⇒ Object (readonly)
Returns the value of attribute first.
132 133 134 |
# File 'lib/geometry/line.rb', line 132 def first @first end |
#last ⇒ Object (readonly)
Returns the value of attribute last.
132 133 134 |
# File 'lib/geometry/line.rb', line 132 def last @last end |
Instance Method Details
#inspect ⇒ Object Also known as: to_s
137 138 139 |
# File 'lib/geometry/line.rb', line 137 def inspect 'Line(' + @first.inspect + ', ' + @last.inspect + ')' end |