Project

cnb

0.01
Repository is archived
No commit activity in last 3 years
No release in over 3 years
Get daily and monthly currency rates from Czech National Bank.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

~> 1.6
 Project Readme

CNB

Gem Version Build Status Dependency Status Code Climate Test Coverage

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

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

License

MIT License. Copyright (c) 2014