abstract class Money::Currency::RateProvider

Included Modules

Extended Modules

Direct Known Subclasses

Defined in:

money/currency/rate_provider.cr
money/currency/rate_provider/error.cr

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.new(ctx : YAML::ParseContext, node : YAML::Nodes::Node) #

Alias of Converter.from_yaml.


def self.new(pull : JSON::PullParser) #

Alias of Converter.from_json.


Class Method Detail

def self.find(name : String | Symbol) : Money::Currency::RateProvider.class #

Returns the Money::Currency::RateProvider.class for the given name if found, raises Money::Registry::NotFoundError otherwise.


def self.find?(name : String | Symbol) : Money::Currency::RateProvider.class | Nil #

Returns the Money::Currency::RateProvider.class for the given name if found, nil otherwise.


def self.registry #

All registered objects.


Instance Method Detail

abstract def base_currency_codes : Array(String) #

Returns an array of supported base currency codes.


[View source]
abstract def exchange_rate?(base : Currency, target : Currency) : Rate | Nil #

Returns the exchange rate between base and target currency, or nil if not found.


[View source]
def supports_currency_pair?(base : Currency, target : Currency) : Bool #

Returns true if the provider supports the given currency pair.


[View source]
def target_currency_codes : Array(String) #

Returns an array of supported target currency codes.


[View source]