abstract class
Money::Currency::RateProvider
- Money::Currency::RateProvider
- Reference
- Object
Included Modules
- JSON::Serializable
- YAML::Serializable
Extended 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.crmoney/currency/rate_provider/error.cr
Constructors
-
.new(ctx : YAML::ParseContext, node : YAML::Nodes::Node)
Alias of
Converter.from_yaml
. -
.new(pull : JSON::PullParser)
Alias of
Converter.from_json
.
Class Method Summary
-
.find(name : String | Symbol) : Money::Currency::RateProvider.class
Returns the
Money::Currency::RateProvider.class
for the given name if found, raisesMoney::Registry::NotFoundError
otherwise. -
.find?(name : String | Symbol) : Money::Currency::RateProvider.class | Nil
Returns the
Money::Currency::RateProvider.class
for the given name if found,nil
otherwise. -
.registry
All registered objects.
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 Money::Currency::RateProvider.class
for the given name if found,
raises Money::Registry::NotFoundError
otherwise.
Returns the Money::Currency::RateProvider.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.