Project

moneyc

0.0
Repository is archived
No commit activity in last 3 years
No release in over 3 years
Convert your currency with simple lib
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.7
~> 0.10
>= 10.4, ~> 11.3
~> 3.1
 Project Readme

Currency Converter

Build Status Code Climate Test Coverage Dependency Status Inline docs

Moneyc is a library that allows you to get the exchange rate and conversion of one currency to another. This library uses the API of the European Central Bank via Fixer.io.

Get historical rates for any day since 1999 (2000 January 3).

Links:

Installation

gem 'moneyc'

or

gem install moneyc

Use it

require 'moneyc'

# Convert 7.55 EUR to USD
Moneyc::Converter.new(from: 'EUR', to: 'USD').convert(7.55)
# => Float

# Convert with specific date 7.55 EUR to USD
Moneyc::Converter.new(from: 'EUR', to: 'USD', at: Time.now).convert(7.55)
# => Float

# Get today rate (EUR to USD)
Moneyc::Converter.new(from: 'EUR', to: 'USD').rate
# => Integer or Float

# Get specific date rate (EUR to USD)
Moneyc::Converter.new(from: 'EUR', to: 'USD', at: Time.now).rate
# => Integer or Float