operator - method

Money operator -(
  1. Money subtrahend
)

Subtracts right operand from the left one.

Both operands must be in same currency, ArgumentError will be thrown otherwise.

Implementation

Money operator -(Money subtrahend) {
  _preconditionThatCurrencyTheSameFor(subtrahend);

  return _withAmount(amount - subtrahend.amount);
}