Cambio
A gem to wrap the Open Exchange Rates API from http://openexchangerates.org
Installation
Add this line to your application's Gemfile:
gem 'cambio'
And then execute:
$ bundle
Or install it yourself as:
$ gem install cambio
Usage
First you will need an App ID, you can sign up for one at https://openexchangerates.org/signup.
Cambio.configure do |config|
config.app_id
end
Get the latest exchange rates
Cambio.latest
You can also get the raw JSON response
Cambio.latest :raw => true
Get the currencies available through the API
Cambio.currencies
# or
Cambio.currencies :raw => true
Get the historical exchange rates
Cambio.historical('2012-08-17')
# or with a date object
Cambio.historical(Date.parse('17/08/2012'))
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