Class: Tcxxxer::TrackPoint
- Inherits:
-
Object
- Object
- Tcxxxer::TrackPoint
- Defined in:
- lib/tcxxxer/track_point.rb
Constant Summary collapse
- @@attributes =
[ :altitude, :cadence, :distance, :heart_rate, :latitude, :longitude, :time, :watts, :speed, :joules ]
Instance Attribute Summary collapse
-
#altitude ⇒ Object
Returns the value of attribute altitude.
-
#cadence ⇒ Object
Returns the value of attribute cadence.
-
#distance ⇒ Object
Returns the value of attribute distance.
-
#heart_rate ⇒ Object
Returns the value of attribute heart_rate.
-
#joules ⇒ Object
Returns the value of attribute joules.
-
#latitude ⇒ Object
Returns the value of attribute latitude.
-
#longitude ⇒ Object
Returns the value of attribute longitude.
-
#speed ⇒ Object
Returns the value of attribute speed.
-
#time ⇒ Object
Returns the value of attribute time.
-
#watts ⇒ Object
Returns the value of attribute watts.
Instance Method Summary collapse
-
#initialize ⇒ TrackPoint
constructor
A new instance of TrackPoint.
- #to_hash ⇒ Object
- #zero_all_attrs ⇒ Object
Constructor Details
#initialize ⇒ TrackPoint
Returns a new instance of TrackPoint.
21 22 23 |
# File 'lib/tcxxxer/track_point.rb', line 21 def initialize zero_all_attrs end |
Instance Attribute Details
#altitude ⇒ Object
Returns the value of attribute altitude.
4 5 6 |
# File 'lib/tcxxxer/track_point.rb', line 4 def altitude @altitude end |
#cadence ⇒ Object
Returns the value of attribute cadence.
5 6 7 |
# File 'lib/tcxxxer/track_point.rb', line 5 def cadence @cadence end |
#distance ⇒ Object
Returns the value of attribute distance.
6 7 8 |
# File 'lib/tcxxxer/track_point.rb', line 6 def distance @distance end |
#heart_rate ⇒ Object
Returns the value of attribute heart_rate.
7 8 9 |
# File 'lib/tcxxxer/track_point.rb', line 7 def heart_rate @heart_rate end |
#joules ⇒ Object
Returns the value of attribute joules.
13 14 15 |
# File 'lib/tcxxxer/track_point.rb', line 13 def joules @joules end |
#latitude ⇒ Object
Returns the value of attribute latitude.
8 9 10 |
# File 'lib/tcxxxer/track_point.rb', line 8 def latitude @latitude end |
#longitude ⇒ Object
Returns the value of attribute longitude.
9 10 11 |
# File 'lib/tcxxxer/track_point.rb', line 9 def longitude @longitude end |
#speed ⇒ Object
Returns the value of attribute speed.
12 13 14 |
# File 'lib/tcxxxer/track_point.rb', line 12 def speed @speed end |
#time ⇒ Object
Returns the value of attribute time.
10 11 12 |
# File 'lib/tcxxxer/track_point.rb', line 10 def time @time end |
#watts ⇒ Object
Returns the value of attribute watts.
11 12 13 |
# File 'lib/tcxxxer/track_point.rb', line 11 def watts @watts end |
Instance Method Details
#to_hash ⇒ Object
31 32 33 34 35 |
# File 'lib/tcxxxer/track_point.rb', line 31 def to_hash @@attributes.each_with_object({}) { |a,h| h[a] = instance_variable_get "@#{a}" } end |
#zero_all_attrs ⇒ Object
25 26 27 28 29 |
# File 'lib/tcxxxer/track_point.rb', line 25 def zero_all_attrs @@attributes.each do |a| instance_variable_set "@#{a}", 0 end end |