Minimal, idiomatic Ruby client for OpenExchangeAPI
- All endpoints supported
- API key is optional
- Returns hashes for all responses
Add open_exchange_api_client.rb
to your project, or use Bundler:
gem 'open_exchange_api_client', git: 'https://github.com/OpenExchangeAPI/sdk-ruby'
require_relative 'open_exchange_api_client'
client = OpenExchangeApiClient.new('YOUR_API_KEY') # API key optional
latest = client.get_latest('EUR')
puts latest['rates']['USD']
precise = client.get_latest_precise('EUR')
puts precise['rates']['USD']
get_latest(base = nil)
get_latest_precise(base = nil)
get_historical(date, base = nil)
get_historical_precise(date, base = nil)
convert(from, to, amount)
convert_precise(from, to, amount)
list_currencies(type = nil)
get_currency(code)
All methods raise on error.
MIT