lib/runby_pace/distance.rb in runby_pace-0.6.99 vs lib/runby_pace/distance.rb in runby_pace-0.6.100
- old
+ new
@@ -57,13 +57,18 @@
"#{format('%g', @multiplier.round(2))} #{pluralized_uom}"
end
def pluralized_uom
uom_description = @uom.description.downcase
- if @multiplier > 1 then
+ if @multiplier > 1
uom_description += 's'
end
uom_description
+ end
+
+ def ==(other)
+ raise "Cannot compare Runby::Distance to #{other.class}" unless other.is_a? Distance
+ @uom == other.uom && @multiplier == other.multiplier
end
private
def init_from_clone(distance)