diff --git a/lib/delayed/priority.rb b/lib/delayed/priority.rb index 951f628..129a176 100644 --- a/lib/delayed/priority.rb +++ b/lib/delayed/priority.rb @@ -174,11 +174,17 @@ def <=>(other) end def -(other) - to_i - other.to_i + other = other.to_i if other.is_a?(self.class) + self.class.new(to_i - other) end def +(other) - to_i + other.to_i + other = other.to_i if other.is_a?(self.class) + self.class.new(to_i + other) + end + + def to_d + to_i.to_d end private