class Money::NullCurrency


#=> #<Money value:5.00 currency:CAD>
Money.new(0, Money::NULL_CURRENCY) + Money.new(5, ‘CAD’)
@example
the other currency.
NullCurrency with another currency. The resulting Money object will have
Unlike other currencies, it is allowed to calculate a Money object with
safeties.
this sidesteps these issues and provides additional currency check
of NullCurrency. Prefer using Money.new(0, currency) where possible, as
database validations or GraphQL enum not allowing the string representation
Money with NullCurrency has behaviour that may surprise you, such as
Money.new(2, ‘CAD’) >= 0 #=> true
Money.new(1, ‘CAD’).positive? #=> true
@example
Comparison operators with Numeric (==, !=, <=, =>, <, >) work as well.
Numeric predicate methods like #positive?/#negative?/#zero?/#nonzero?.
For comparisons where you don’t know the currency beforehand, you can use
NullCurrency:
Here follows a list of preferred alternatives over using Money with
of currency.
behaves like a dollar, which is how this gem worked before the introduction
directly. It’s here mostly for backwards compatibility and for that reason
as defined by ISO4217. You should rarely, if ever, need to use this
A placeholder currency for instances where no actual currency is available,

def compatible?(other)

def compatible?(other)
  other.is_a?(Currency) || other.is_a?(NullCurrency)
end

def eql?(other)

def eql?(other)
  self.class == other.class && iso_code == other.iso_code
end

def initialize

def initialize
  @symbol                = '$'
  @disambiguate_symbol   = nil
  @subunit_symbol        = nil
  @iso_code              = 'XXX'
  @iso_numeric           = '999'
  @name                  = 'No Currency'
  @smallest_denomination = 1
  @subunit_to_unit       = 100
  @minor_units           = 2
  @decimal_mark          = '.'
  freeze
end

def to_s

def to_s
  ''
end