Navfund is a ruby gem that fetches the values of the current NAVPU/NAVPS of several UITFs/Mutual Funds. Currently it only supports Philippine providers.
Add this line to your application's Gemfile:
gem 'navfund'
And then execute:
bundle
Or install it yourself as:
gem install navfund
Get a list of supported Providers:
Navfund::Providers
Initialize a Provider's data:
@metrobank = Navfund::Metrobank.new
To get a list of supported funds for a specific Provider:
Navfund::Metrobank::Funds
@metrobank.funds # if a provider is initialized
Get the current NAVPU/NAVPS of a fund, by name:
@metrobank.value("Equity Fund")
A Navfund::Provider::InvalidFund will be raised if the specified fund is not supported or is invalid.
Get the date in which the value is valid. This returns a Date object:
@metrobank.value_at
To list all fund names with their current values:
@metrobank.fund_values
This returns an array of hashes with all the fund names and their current values.
Install the minitest gem if its not already installed in your system
gem install minitest
Then run the tests (default rake task is the 'test' task):
rake test
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Added some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request