lib/zold/amount.rb in zold-0.14.49 vs lib/zold/amount.rb in zold-0.14.50
- old
+ new
@@ -109,9 +109,13 @@
def negative?
@coins.negative?
end
+ def positive?
+ @coins.positive?
+ end
+
def *(other)
raise '* may only work with a number' unless other.is_a?(Integer) || other.is_a?(Float)
c = (@coins * other).to_i
raise "Overflow, can't multiply #{@coins} by #{m}" if c > Amount::MAX
Amount.new(coins: c)