Class: Point
Overview
Represents a point
Instance Attribute Summary collapse
-
#latitude ⇒ Object
readonly
Returns the value of attribute latitude.
-
#longitude ⇒ Object
readonly
Returns the value of attribute longitude.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #accept(visitor) ⇒ Object
-
#initialize(name, latitude, longitude) ⇒ Point
constructor
A new instance of Point.
- #to_p ⇒ Object
Methods included from SITACObjects
Constructor Details
#initialize(name, latitude, longitude) ⇒ Point
Returns a new instance of Point.
33 34 35 36 37 38 |
# File 'lib/sitac_objects.rb', line 33 def initialize(name, latitude, longitude) super @name = name @latitude = latitude @longitude = longitude end |
Instance Attribute Details
#latitude ⇒ Object (readonly)
Returns the value of attribute latitude.
28 29 30 |
# File 'lib/sitac_objects.rb', line 28 def latitude @latitude end |
#longitude ⇒ Object (readonly)
Returns the value of attribute longitude.
28 29 30 |
# File 'lib/sitac_objects.rb', line 28 def longitude @longitude end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
28 29 30 |
# File 'lib/sitac_objects.rb', line 28 def name @name end |
Instance Method Details
#accept(visitor) ⇒ Object
40 41 42 |
# File 'lib/sitac_objects.rb', line 40 def accept(visitor) visitor.visit_point self end |
#to_p ⇒ Object
44 45 46 |
# File 'lib/sitac_objects.rb', line 44 def to_p self end |