Class: Navfund::PNB

Inherits:
Provider show all
Defined in:
lib/navfund/providers/philippine_national_bank.rb

Constant Summary collapse

MAIN_URL =

List of funds

"http://www.uitf.com.ph/daily_navpu.php?bank_id=2"
Funds =
[
{:name => "DREAM BUILDER MONEY MARKET FUND", :currency => "PHP", :ticker => ""}, 
{:name => "GLOBAL FILIPINO PESO MONEY MARKET FUND", :currency => "PHP", :ticker => "PNBPSPL:PM"},
{:name => "INSTITUTIONAL MONEY MARKET FUND", :currency => "PHP", :ticker => ""},
{:name => "PRIME PESO MONEY MARKET FUND", :currency => "PHP", :ticker => "PNBMHPR:PM"},
{:name => "AUP GS FUND", :currency => "PHP", :ticker => "ALDUPGS:PM"},
{:name => "PLUS INTERMEDIATE TERM BOND FUND", :currency => "PHP", :ticker => "PNBDRMB:PM"},
{:name => "PRESTIGE BALANCED FUND", :currency => "PHP", :ticker => "PNBMHPT:PM"},
{:name => "AUP EQUITY FUND", :currency => "PHP", :ticker => "ALDUPEQ:PM"},
{:name => "ENHANCED PHIL-INDEX REFERENCE FUND", :currency => "PHP", :ticker => "PNBPHSX:PM"},
{:name => "HIGH DIVIDEND FUND", :currency => "PHP", :ticker => "PNBHIDF:PM"},
{:name => "GLOBAL FILIPINO DOLLAR MONEY MARKET FUND", :currency => "USD", :ticker => "PNBDLPL:PM"},
{:name => "PRIME DOLLAR MONEY MARKET FUND", :currency => "USD", :ticker => "PNBDPRF:PM"},
{:name => "PROFIT DOLLAR INTERMEDIATE TERM BOND FUND", :currency => "USD", :ticker => "PNBDLPR:PM"},
{:name => "AUP DOLLAR FUND", :currency => "USD", :ticker => "ALDUPDL:PM"}
]

Instance Attribute Summary

Attributes inherited from Provider

#funds

Instance Method Summary collapse

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) ⇒ PNB

Returns a new instance of PNB.



24
25
26
27
28
# File 'lib/navfund/providers/philippine_national_bank.rb', line 24

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



31
32
33
# File 'lib/navfund/providers/philippine_national_bank.rb', line 31

def value(fund, fund_type=nil)
  uitf_com_ph_parser(fund)
end

#value_atObject



35
36
37
# File 'lib/navfund/providers/philippine_national_bank.rb', line 35

def value_at
  uitf_com_ph_date_parser
end