abstract class
Money::Currency::RateProvider
- Money::Currency::RateProvider
- Reference
- Object
Included Modules
- JSON::Serializable
Direct Known Subclasses
- Money::Currency::RateProvider::AbstractAPI
- Money::Currency::RateProvider::Coinlayer
- Money::Currency::RateProvider::Compound
- Money::Currency::RateProvider::CurrencyAPI
- Money::Currency::RateProvider::CurrencyBeacon
- Money::Currency::RateProvider::CurrencyLayer
- Money::Currency::RateProvider::ECB
- Money::Currency::RateProvider::ExchangeRateAPI
- Money::Currency::RateProvider::Fixer
- Money::Currency::RateProvider::FloatRates
- Money::Currency::RateProvider::FreecurrencyAPI
- Money::Currency::RateProvider::FXFeed
- Money::Currency::RateProvider::FXRatesAPI
- Money::Currency::RateProvider::MetalpriceAPI
- Money::Currency::RateProvider::MoneyMorph
- Money::Currency::RateProvider::Null
- Money::Currency::RateProvider::OpenExchangeRates
- Money::Currency::RateProvider::UniRateAPI
Defined in:
money/currency/rate_provider.crmoney/currency/rate_provider/error.cr
Constructors
Class Method Summary
-
.find(name : String | Symbol) : RateProvider.class
Returns the rate provider class for the given name if found, raises
UnknownRateProviderError
otherwise. -
.find?(name : String | Symbol) : RateProvider.class | Nil
Returns the rate provider class for the given name if found,
nil
otherwise. -
.registry
All registered rate providers.
Instance Method Summary
-
#base_currency_codes : Array(String)
Returns an array of supported base currency codes.
-
#exchange_rate?(base : Currency, target : Currency) : Rate | Nil
Returns the exchange rate between base and target currency, or
nil
if not found. -
#supports_currency_pair?(base : Currency, target : Currency) : Bool
Returns
true
if the provider supports the given currency pair. -
#target_currency_codes : Array(String)
Returns an array of supported target currency codes.
Constructor Detail
Class Method Detail
Returns the rate provider class for the given name if found,
raises UnknownRateProviderError
otherwise.
Returns the rate provider class for the given name if found,
nil
otherwise.
Instance Method Detail
Returns an array of supported base currency codes.
Returns the exchange rate between base and target currency, or nil
if not found.
Returns true
if the provider supports the given currency pair.
Returns an array of supported target currency codes.