Skip to content

Module WhittakerTech::Midas::Coin::Converter

Converter is a reserved module for future currency conversion logic.

It exists as a clear architectural placeholder to separate concerns:

Related modules:

  • Arithmetic: Integer arithmetic on minor units
  • Allocation: Per-unit pricing interpretation
  • Converter: Cross-currency rate conversion (planned)

When implemented, Converter will handle:

  • Exchange rate sources (live API, snapshot, historical)
  • Historical conversions with a specific timestamp
  • Regulatory rounding rules per jurisdiction

  • @note All methods in this module raise NotImplementedError intentionally. Use the Money gem's exchange rate infrastructure directly for now.

  • @since 0.1.0

Public Instance Methods

convert_to(currency_code, at: = Time.current, using: = nil)

Converts this Coin to another currency.

  • @param currency_code [String] target ISO 4217 currency code
  • @param at [Time] the rate timestamp (for historical conversions)
  • @param using [Object, nil] exchange rate provider / bank override
  • @raise [NotImplementedError] — not yet implemented
  • @return [Coin]
  • @since 0.1.0