lib/hrmparser/workout.rb in teich-hrmparser-0.4.5 vs lib/hrmparser/workout.rb in teich-hrmparser-0.4.6
- old
+ new
@@ -51,7 +51,16 @@
end
def altitudes
@trackpoints.map { |tp| tp.altitude }
end
+
+ def set_distance_from_trackpoints!
+ @trackpoints.reverse_each do |tp|
+ if !tp.distance.nil?
+ self.distance = tp.distance
+ break
+ end
+ end
+ end
end
end
\ No newline at end of file