Project

nbu_rates

0.0
No release in over a year
Fetches currency rates from https://bank.gov.ua/
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

~> 6
~> 1.9
 Project Readme

NBU Rates

Gem for fetching currency from National bank of Ukraine

This is a version to parse XML response. Version to parse JSON you can find at nbu_json branch.

Installation

Add this line to your application's Gemfile:

gem 'nbu_rates'

And then execute:

$ bundle install

Or install it yourself as:

$ gem install nbu_rates

Usage

require 'nbu_rates'

usd = Money.new('1_50', 'USD')

result = NbuRates.new.exchange(usd, 'CAD')

puts "1.50 USD ~> CAD: #{result.format}"

How to work with object Money: documentation

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/Dmytrenko-I/nbu_rates.

License

The gem is available as open source under the terms of the MIT License.