eu_central_bank icon indicating copy to clipboard operation
eu_central_bank copied to clipboard

Function that checks if the currency is supported

Open KnotScientific opened this issue 3 years ago • 0 comments

Hi, I was wondering if there is/could be a function that returns a boolean on whether or not a currency is supported by eu_central_bank. I know currently there is a function check_currency_available(currency) but that raises an exception if the currency rate doesn't exist. Can there be a function which returns false if the currency rate doesn't exist and true if it does.

def currency_available(currency)?
    currency_string = currency.to_s
    return true if currency_string == "EUR"
    return CURRENCIES.include?(currency_string)
end

KnotScientific avatar Apr 13 '22 23:04 KnotScientific