lib/zold/amount.rb in zold-0.14.8 vs lib/zold/amount.rb in zold-0.14.9

- old
+ new

@@ -1,5 +1,7 @@ +# frozen_string_literal: true + # Copyright (c) 2018 Yegor Bugayenko # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the 'Software'), to deal # in the Software without restriction, including without limitation the rights @@ -104,10 +106,10 @@ def zero? @coins.zero? end def negative? - @coins < 0 + @coins.negative? end def *(other) c = (@coins * other).to_i raise "Overflow, can't multiply #{@coins} by #{m}" if c > Amount::MAX