CNB
CNB is a gem that will help you get daily and monthly currency rates for czech crown (CZK) from Czech National Bank.
Install
Add following into your Gemfile
gem 'cnb'
Or install the gem by on your own
gem install cnb
Usage
Daily
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')
Monthly
CNB.monthly_rate('ALL', Date.today)
Returns today's exchange rate between CZK and ALL (Albanian lek).
Exceptions
- 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.
Contributing
- 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
License
MIT License. Copyright (c) 2014