abstract class Money::Currency::RateProvider

Included Modules

Direct Known Subclasses

Defined in:

money/currency/rate_provider.cr

Constructors

Class Method Summary

Instance Method Summary

Instance methods inherited from module Money::Mixin::InitializeWith

initialize_with(attributes)
initialize_with(**attributes)
initialize_with

Constructor Detail

def self.build(name : String, options : NamedTuple | Hash) : RateProvider #

Creates a new rate provider instance.


[View source]
def self.build(name : String, **options) : RateProvider #

Creates a new rate provider instance.


[View source]

Class Method Detail

def self.providers #

All registered rate providers.


[View source]

Instance Method Detail

abstract def base_currency_codes : Array(String) #

Returns an array of supported base currency codes.


[View source]
abstract def exchange_rate?(base : Currency, target : Currency) : Rate | Nil #

Returns the exchange rate between base and target currency, or nil if not found.


[View source]
def supports_currency_pair?(base : Currency, target : Currency) : Bool #

Returns true if the provider supports the given currency pair.


[View source]
def target_currency_codes : Array(String) #

Returns an array of supported target currency codes.


[View source]