CNB is a gem that will help you get daily and monthly currency rates for czech crown (CZK) from Czech National Bank.
Add following into your Gemfile
gem 'cnb'
Or install the gem by on your own
gem install cnb
CNB.daily_rate('AUD', Date.today)
Returns today's exchange rate between CZK and AUD. Input date defaults to Date.today so the above line can written like this:
CNB.daily_rate('AUD')
CNB.monthly_rate('ALL', Date.today)
Returns today's exchange rate between CZK and ALL (Albanian lek).
- DateTooOld - triggers when date entered is older than 24 years, or 10 years if monthly.
- DateInFuture - triggers when date enetered is in future.
- CurrencyMissing - triggers when currency is not present.
- CurrencyNotSupported - triggers when currency is not in downloaded list of currencies.
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request
MIT License. Copyright (c) 2014