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::BitPay
- Money::Currency::RateProvider::CBR
- Money::Currency::RateProvider::Coinbase
- Money::Currency::RateProvider::CoinGecko
- Money::Currency::RateProvider::Coinlayer
- Money::Currency::RateProvider::CoinMarketCap
- Money::Currency::RateProvider::Compound
- Money::Currency::RateProvider::CurrencyAPI
- Money::Currency::RateProvider::CurrencyBeacon
- Money::Currency::RateProvider::CurrencyLayer
- Money::Currency::RateProvider::ECB
- Money::Currency::RateProvider::Exchangerate
- 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::NBP
- 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. - .new(*, __pull_for_json_serializable pull : JSON::PullParser)
- .new(*, __context_for_yaml_serializable ctx : YAML::ParseContext, __node_for_yaml_serializable node : YAML::Nodes::Node)
Class Method Summary
-
.find(name : String | Symbol) : Money::Currency::RateProvider.class
Returns the
Money::Currency::RateProvider.classfor the given name if found, raisesMoney::Registry::NotFoundErrorotherwise. -
.find?(name : String | Symbol) : Money::Currency::RateProvider.class | Nil
Returns the
Money::Currency::RateProvider.classfor the given name if found,nilotherwise. -
.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
nilif not found. -
#supports_currency_pair?(base : Currency, target : Currency) : Bool
Returns
trueif 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.