module Mint::FixerCurrency
Access to foreign exchange rates from Fixer.io
@author Renat Ibragimov <renat@aomega.co>
Constants
- VERSION
Public Class Methods
currencies()
click to toggle source
List of available currencies @return [Array<Symbols>]
# File lib/mint/fixer_currency.rb, line 24 def self.currencies %i[AUD BGN BRL CAD CHF CNY CZK DKK GBP HKD HRK HUF IDR ILS INR JPY KRW MXN MYR NOK NZD PHP PLN RON RUB SEK SGD TRY USD ZAR EUR] end
rates(currency = :USD, date = nil)
click to toggle source
Gets you currency exchange rates @param currency [Symbol, String] based currency @param date [String] YYYY-MM-DD optional date or latest by default @return [Hash]
# File lib/mint/fixer_currency.rb, line 16 def self.rates(currency = :USD, date = nil) currency = currency.to_s.upcase.to_sym raise(WrongCurrencyError, currency) unless currencies.include? currency Request.new(currency, date).perform! end