Project

redis-bank

0.01
No commit activity in last 3 years
No release in over 3 years
Redis-backed Bank for the Money gem based on the VariableExchange Bank
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0
>= 0
>= 0
>= 0
>= 0

Runtime

 Project Readme

Redis-Bank

A Redis-backed Bank for the {https://github.com/RubyMoney/money Money} gem.

See {Money::Bank::RedisBank} for details.

Usage

redis_client = Redis.new
Money.bank = Money::Bank::RedisBank.new redis_client
Money.bank.add_rate("USD", "CAD", 1.24515)
Money.bank.add_rate("CAD", "USD", 0.803115)
Money.us_dollar(100).exchange_to("CAD") => Money.ca_dollar(124)
Money.ca_dollar(100).exchange_to("USD") => Money.us_dollar(80)
Money.bank.rates => {"usd_to_cad" => 1.24515,
                     "cad_to_usd" => 0.803115}