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::CurrencyBeacon
- Money::Currency::RateProvider::ECB
- Money::Currency::RateProvider::ExchangeRateAPI
- Money::Currency::RateProvider::Fixer
- Money::Currency::RateProvider::FloatRates
- Money::Currency::RateProvider::Freecurrency
- Money::Currency::RateProvider::FXRatesAPI
- Money::Currency::RateProvider::MoneyMorph
- Money::Currency::RateProvider::Null
- Money::Currency::RateProvider::OpenExchangeRates
- Money::Currency::RateProvider::UniRate
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
-
.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
def self.build(name : String, options : NamedTuple | Hash) : RateProvider
#
Creates a new rate provider instance.
Class Method Detail
Instance Method Detail
abstract
def base_currency_codes : Array(String)
#
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.