Project

fixer-rb

0.0
No commit activity in last 3 years
No release in over 3 years
API wrapper of fixer.io, find usage on https://github.com/gaotongfei/fixer
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Development

~> 1.15
~> 5.0
~> 10.0

Runtime

 Project Readme

Fixer

Build Status

Fixer is a simple API wrapper of http://fixer.io/ to provide a clean way of converting currency

Install

gem install 'fixer-rb'

Usage

To convert Chinese Yuan to US Dollars, simply do this

require 'fixer'

fixer = Fixer::Request.new 'CNY'
params = {target: 'USD', ammount: 1000}

fixer.transfer(params)  # 149.75
$ 149.75

Get currency rate

fixer.get_rate do |rate|
  usd = rate.USD  # 0.14975
  rate_in_hash = rate.to_h
  rate_in_json = rate.to_json
end

$ 0.14975

Supported Currencies

  • CNY
  • AUD
  • BGN
  • BRL
  • CAD
  • CHF
  • CZK
  • DKK
  • GBP
  • HKD
  • HRK
  • HUF
  • IDR
  • ILS
  • INR
  • JPY
  • KRW
  • MXN
  • MYR
  • NOK
  • NZD
  • PHP
  • PLN
  • RON
  • RUB
  • SEK
  • SGD
  • THB
  • TRY
  • USD
  • ZAR
  • EUR