lib/runby_pace/pace.rb in runby_pace-0.6.125 vs lib/runby_pace/pace.rb in runby_pace-0.6.126
- old
+ new
@@ -18,9 +18,10 @@
end
end
def convert_to(target_distance)
target_distance = Distance.new(target_distance) unless target_distance.is_a?(Distance)
+ return self if @distance == target_distance
conversion_factor = target_distance / @distance
Pace.new @time * conversion_factor, target_distance
end
def to_s(format: :short)