OpenexchangeConvert
Description:
OpenexchangeConvert is a simple realtime opensource currency converter. It's a very simple Gem that can be used in any ruby project just follow the instructions. It requires an account a free account at https://openexchangerates.org/ that is the backbone of this realtime currency converter.
Installation
Add this line to your application's Gemfile:
gem 'openexchange_convert'
And then execute:
$ bundle
Or install it yourself as:
$ gem install openexchange_convert
Usage
Sign up and Get a API key from https://openexchangerates.org/
Create a new Object and pass the api key in there like
convert = OpenexchangeConvert::ConvertCurrency(api_key)
- call one of the following methods on that object
For example
convert = OpenexchangeConvert::ConvertCurrency(api_key) convert.convert_to_foreign('EUR', 100) or convert.convert_to_foreign('EUR', '100') # either will return
methods:
get_all_exchange_rates get_exchange_rate(currencytype) # string convert_to_usd(currency, amount) # string, amount can be string or # integer convert_to_foreign(currency, amount) # string, amount can be string or # integer
TODO
- Exception Handling
- More Functionality
- Better testing
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