Simple Currency Converter based on ECB data
Add this line to your application's Gemfile:
gem 'FX_Rates'
And then execute:
$ bundle
Or install it yourself as:
$ gem install FX_Rates
Create an instance of ExchangeRate class (Make sure you have network connection for latest rates) by:
$ require 'FX_Rates'
$ rates = FXRates::ExchangeRate.new
To view the list of currencies supported:
$ rates.currencies
To view the list of dates for which rates are available (upto 90 days from current date):
$ rates.dates
To convert between two available currencies on a specific date:
$ rates.at(date, from_currency, to_currency)
- Fork it ( https://github.com/[my-github-username]/FX_Rates/fork )
- 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 a new Pull Request