Class: Natour::GPSTrackPoint
- Inherits:
-
Object
- Object
- Natour::GPSTrackPoint
- Includes:
- Comparable
- Defined in:
- lib/natour/gps_track_point.rb
Instance Attribute Summary collapse
-
#elevation ⇒ Object
readonly
Returns the value of attribute elevation.
-
#latitude ⇒ Object
readonly
Returns the value of attribute latitude.
-
#longitude ⇒ Object
readonly
Returns the value of attribute longitude.
-
#time ⇒ Object
readonly
Returns the value of attribute time.
Instance Method Summary collapse
- #<=>(other) ⇒ Object
- #hash ⇒ Object
-
#initialize(latitude, longitude, elevation, time) ⇒ GPSTrackPoint
constructor
A new instance of GPSTrackPoint.
Constructor Details
#initialize(latitude, longitude, elevation, time) ⇒ GPSTrackPoint
Returns a new instance of GPSTrackPoint.
8 9 10 11 12 13 |
# File 'lib/natour/gps_track_point.rb', line 8 def initialize(latitude, longitude, elevation, time) @latitude = latitude @longitude = longitude @elevation = elevation @time = time end |
Instance Attribute Details
#elevation ⇒ Object (readonly)
Returns the value of attribute elevation.
5 6 7 |
# File 'lib/natour/gps_track_point.rb', line 5 def elevation @elevation end |
#latitude ⇒ Object (readonly)
Returns the value of attribute latitude.
3 4 5 |
# File 'lib/natour/gps_track_point.rb', line 3 def latitude @latitude end |
#longitude ⇒ Object (readonly)
Returns the value of attribute longitude.
4 5 6 |
# File 'lib/natour/gps_track_point.rb', line 4 def longitude @longitude end |
#time ⇒ Object (readonly)
Returns the value of attribute time.
6 7 8 |
# File 'lib/natour/gps_track_point.rb', line 6 def time @time end |
Instance Method Details
#<=>(other) ⇒ Object
17 18 19 20 |
# File 'lib/natour/gps_track_point.rb', line 17 def <=>(other) [@latitude, @longitude, @elevation, @time] <=> [other.latitude, other.longitude, other.elevation, other.time] end |
#hash ⇒ Object
22 23 24 |
# File 'lib/natour/gps_track_point.rb', line 22 def hash [@latitude, @longitude, @elevation, @time].hash end |