Holdings
Holding is a simple gem to keep track of your holdings in a given currency/stock and convert back and forward between the quote currency and base currency at a given exchange rate.
Installation
Add this line to your application's Gemfile:
gem 'holdings'
And then execute:
$ bundle
Or install it yourself as:
$ gem install holdings
Usage
acc = Holdings::Simple.new(['aud_usd'], { usd: 100.0 })
acc.usd_to_aud(100.0, 1.0)
acc.aud_bal # 99.8 because of built in fee calculation
Contributing
- Fork it ( http://github.com/
/holdings/fork ) - Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request