Class: Navfund::Metrobank
- Defined in:
- lib/navfund/providers/metrobank.rb
Constant Summary collapse
- MAIN_URL =
List of funds
"http://www.uitf.com.ph/daily_navpu.php?bank_id=1"- Funds =
[ {:name => "Money Market Fund", :currency => "PHP", :ticker => "MBSTART:PM"}, {:name => "Max-3 Bond Fund", :currency => "PHP", :ticker => "MBELITE:PM"}, {:name => "Wealth Builder Fund", :currency => "PHP", :ticker => "MBIPLUS:PM"}, {:name => "Max-5 Bond Fund", :currency => "PHP", :ticker => "MBPKEAR:PM"}, {:name => "Balanced Fund", :currency => "PHP", :ticker => "MBCAPGR:PM"}, {:name => "Equity Fund", :currency => "PHP", :ticker => "MBEQITY:PM"}, {:name => "High Dividend Yield Fund", :currency => "PHP", :ticker => ""}, {:name => "PSEi Tracker Fund", :currency => "PHP", :ticker => ""}, {:name => "$ Money Market Fund", :currency => "USD", :ticker => "MBDMMKF:PM"}, {:name => "$ Max-3 Bond Fund", :currency => "USD", :ticker => "MBPHLIQ:PM"}, {:name => "$ Max-5 Bond Fund", :currency => "USD", :ticker => "MBPHLBD:PM"} ]
Instance Attribute Summary
Attributes inherited from Provider
Instance Method Summary collapse
-
#initialize(main_url = nil) ⇒ Metrobank
constructor
A new instance of Metrobank.
-
#value(fund, fund_type = nil) ⇒ Object
Fetch the current value.
- #value_at ⇒ Object
Methods inherited from Provider
#fund_names, #fund_values, #scrape, strip_value, #uitf_com_ph_date_parser, #uitf_com_ph_parser, #valid_fund?
Constructor Details
#initialize(main_url = nil) ⇒ Metrobank
Returns a new instance of Metrobank.
21 22 23 24 25 |
# File 'lib/navfund/providers/metrobank.rb', line 21 def initialize(main_url=nil) @url = main_url ||= MAIN_URL @funds = Funds scrape end |
Instance Method Details
#value(fund, fund_type = nil) ⇒ Object
Fetch the current value
28 29 30 |
# File 'lib/navfund/providers/metrobank.rb', line 28 def value(fund, fund_type=nil) uitf_com_ph_parser(fund) end |
#value_at ⇒ Object
32 33 34 |
# File 'lib/navfund/providers/metrobank.rb', line 32 def value_at uitf_com_ph_date_parser end |