Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions lib/alchemist/measurement.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down