Money.compare-exclamation-mark

You're seeing just the function compare-exclamation-mark, go back to Money module for more information.
Link to this function

compare!(money_1, money_2)

View Source

Compares two Money values numerically and raises on error.

Arguments

  • money_1 and money_2 are any valid Money.t types returned by Money.new/2

Returns

  • :gt | :eq | :lt or

  • raises an exception

Examples

Money.compare! Money.new(:USD, 200), Money.new(:CAD, 500)
** (ArgumentError) Cannot compare monies with different currencies. Received :USD and :CAD.