Sha256: d4b1529370a45778f4255356815c79f3352ca1eb5a2e02568582386c4728a410
Contents?: true
Size: 917 Bytes
Versions: 7
Compression:
Stored size: 917 Bytes
Contents
# frozen_string_literal: true class Money class NullCurrency attr_reader :iso_code, :iso_numeric, :name, :smallest_denomination, :subunit_symbol, :subunit_to_unit, :minor_units, :symbol, :disambiguate_symbol, :decimal_mark def initialize @symbol = '$' @disambiguate_symbol = nil @subunit_symbol = nil @iso_code = 'XXX' # Valid ISO4217 @iso_numeric = '999' @name = 'No Currency' @smallest_denomination = 1 @subunit_to_unit = 100 @minor_units = 2 @decimal_mark = '.' freeze end def compatible?(other) other.is_a?(Currency) || other.is_a?(NullCurrency) end def eql?(other) self.class == other.class && iso_code == other.iso_code end def to_s '' end alias_method :==, :eql? end end
Version data entries
7 entries across 7 versions & 1 rubygems