Class: Line
Overview
Represents a line, given a list of points
Direct Known Subclasses
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#points ⇒ Object
readonly
Returns the value of attribute points.
Instance Method Summary collapse
- #accept(visitor) ⇒ Object
-
#initialize(name, points) ⇒ Line
constructor
A new instance of Line.
Methods included from SITACObjects
Constructor Details
#initialize(name, points) ⇒ Line
Returns a new instance of Line.
55 56 57 58 59 60 61 62 |
# File 'lib/sitac_objects.rb', line 55 def initialize(name, points) super @name = name @points = [] points.each do |point| @points << as_point(point) end end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
51 52 53 |
# File 'lib/sitac_objects.rb', line 51 def name @name end |
#points ⇒ Object (readonly)
Returns the value of attribute points.
51 52 53 |
# File 'lib/sitac_objects.rb', line 51 def points @points end |
Instance Method Details
#accept(visitor) ⇒ Object
64 65 66 |
# File 'lib/sitac_objects.rb', line 64 def accept(visitor) visitor.visit_line self end |