This is a Ruby interface into the exchangerate-api service. www.exchangerate-api.com/ claims to serv accurate currency exchange rates from the European Central Reserve Bank as they are released.
gem install exchangerate
Before you use this library please get the api key from www.exchangerate-api.com/api-key
require ‘rubygems’ require ‘exchangerate’ #To convert 300 USD to Indian Rupee er=ExchangeRate.new(“my-api-key”) er.convert(“USD”,“INR”,“300.00”) =>“14047.51”
#To convert USD to EUR
er.convert(“USD”,“INR”,“300.00”) =>“243.23”