No commit activity in last 3 years
No release in over 3 years
Wraps a simple scraper to retrieve the historic exchange rates for Tanzanian Shillings (TZS). Returns the average (between buy and sell) rates for yesterday or any day specified and supported by the Bank of Tanzania.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Development

~> 3.3

Runtime

~> 1.6
 Project Readme

Bank of Tanzania Historic Exchange Rates

Wraps a simple scraper to retrieve the historic exchange rates for Tanzanian Shillings (TZS). Returns the average (between buy and sell) rates for yesterday or any day specified and supported by the Bank of Tanzania.

Install

Add this line to your application's Gemfile:

  gem 'bank_of_tanzania'

And then execute:

$ bundle

Or install it yourself as:

  $ gem install bank_of_tanzania

Usage

Initialize

  xe = BankOfTanzania::HistoricRates.new as_of: Date.new(2015, 10, 24)
  xe.import! # => true

import! returns true if rates have been found. Might also throw HTTP errors. It will also return false when requesting rates for weekend days.

Retrieve a specific rate

  xe.rate('TZS', 'EUR') # => 2105.625

Get all available currencies:

  xe.currencies # => ['KES', 'RWF', 'USD', 'EUR', … ]

Get all rates

  xe.rates # => { 'KES'=>2105.625, 'RWF'=>288.49, … }

Legal

The author of this gem is not affiliated with the National Bank of Rwanda.

License

GPLv3, see LICENSE file

No Warranty

The Software is provided "as is" without warranty of any kind, either express or implied, including without limitation any implied warranties of condition, uninterrupted use, merchantability, fitness for a particular purpose, or non-infringement.