abstract class
Money::Currency::RateProvider
- Money::Currency::RateProvider
- Reference
- Object
Included Modules
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.crConstructors
-
.build(name : String, options : NamedTuple | Hash) : RateProvider
Creates a new rate provider instance.
-
.build(name : String, **options) : RateProvider
Creates a new rate provider instance.
Class Method Summary
-
.find(name : String) : RateProvider.class
Returns the rate provider class for the given name if found, raises
UnknownRateProviderError
otherwise. -
.find?(name : String) : RateProvider.class | Nil
Returns the rate provider class for the given name if found,
nil
otherwise. -
.providers
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.
Instance methods inherited from module Money::Mixin::InitializeWith
initialize_with(attributes)initialize_with(**attributes) initialize_with
Constructor Detail
Creates a new rate provider instance.
Creates a new rate provider instance.
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.