No commit activity in last 3 years
No release in over 3 years
Using convert currency with realtime openexchange data
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Development

~> 1.3
>= 0
>= 0

Runtime

~> 1.7.7
 Project Readme

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

  1. Sign up and Get a API key from https://openexchangerates.org/

  2. Create a new Object and pass the api key in there like

Example

convert = OpenexchangeConvert::ConvertCurrency(api_key)
  1. Call one of the following methods on that object

Example

convert = OpenexchangeConvert::ConvertCurrency(api_key)
convert.convert_to_foreign('EUR', 100) # integer
       or
convert.convert_to_foreign('EUR', '100') #  string 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

  1. Exception Handling
  2. More Functionality
  3. Better testing

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