lib/zold/amount.rb in zold-0.13.34 vs lib/zold/amount.rb in zold-0.13.35
- old
+ new
@@ -84,9 +84,14 @@
def <=(other)
raise '<= may only work with Amount' unless other.is_a?(Amount)
@coins <= other.to_i
end
+ def <=>(other)
+ raise '<= may only work with Amount' unless other.is_a?(Amount)
+ @coins <=> other.to_i
+ end
+
def +(other)
raise '+ may only work with Amount' unless other.is_a?(Amount)
Amount.new(coins: @coins + other.to_i)
end