diff --git a/lib/alchemist/measurement.rb b/lib/alchemist/measurement.rb index 5937bae..27a287b 100644 --- a/lib/alchemist/measurement.rb +++ b/lib/alchemist/measurement.rb @@ -84,11 +84,13 @@ def to_f end def <=> other - to_f <=> other.to(unit_name).to_f + other = other.to(unit_name) unless other.is_a?(Numeric) + to_f <=> other.to_f end def == other - to_f <=> other.to(unit_name).to_f + other = other.to(unit_name) unless other.is_a?(Numeric) + to_f <=> other.to_f end def types