Project

cambio

0.0
No commit activity in last 3 years
No release in over 3 years
A simple wrapper for the Open Exchange Rates API
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 2.2.4
~> 1.8.8

Runtime

~> 0.8.1
~> 1.2.0
 Project Readme

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 = 'YOUR 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'))

Supported Ruby versions

This has been tested with ruby 1.9.2 and 1.9.3

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