lib/big_money.rb in big_money-1.2.1 vs lib/big_money.rb in big_money-1.2.2
- old
+ new
@@ -84,9 +84,17 @@
def nonzero?
amount.nonzero? && self
end
+ def positive?
+ self > self.class.new(0, self.currency)
+ end
+
+ def negative?
+ self < self.class.new(0, self.currency)
+ end
+
def <=>(money)
money.kind_of?(self.class) ? (currency <=> money.currency).nonzero? || (amount <=> money.amount).nonzero? || 0 : nil
end
def eql?(money)