Class: Navfund::UnionBank

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

Constant Summary collapse

MAIN_URL =

List of funds

"http://www.uitf.com.ph/daily_navpu.php?bank_id=13"
Funds =
[
{:name => "UnionBank Peso Short Term Fixed Income Portfolio", :currency => "PHP", :ticker => "IFDPMMP:PM"}, 
{:name => "UnionBank Infinity Prime Fund", :currency => "PHP", :ticker => "IFDPRIM:PM"},
{:name => "UnionBank Medium Term Fixed Income Portfolio", :currency => "PHP", :ticker => ""},
{:name => "UnionBank Philippine Peso Fixed Income Portfolio", :currency => "PHP", :ticker => "IFDPPBP:PM"},
{:name => "UnionBank Long Term Fixed Income Portfolio", :currency => "PHP", :ticker => "IFDLTCI:PM"},
{:name => "UnionBank Tax Exempt Portfolio", :currency => "PHP", :ticker => ""},
{:name => "UnionBank Peso Balanced Portfolio", :currency => "PHP", :ticker => "UNPESBA:PM"},
{:name => "UnionBank Dividend Play Equity Fund", :currency => "PHP", :ticker => ""},
{:name => "UnionBank Dividend Play Equity Portfolio", :currency => "PHP", :ticker => "UBPDIVP:PM"},
{:name => "UnionBank Large Capitalization Philippine Equity Portfolio", :currency => "PHP", :ticker => "IFDLCPE:PM"},
{:name => "UnionBank Philippine Equity Index Tracker Fund Portfolio", :currency => "PHP", :ticker => "UBPHEIT:PM"},
{:name => "UnionBank Dollar Bond Portfolio", :currency => "USD", :ticker => "IFPHDLB: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) ⇒ UnionBank

Returns a new instance of UnionBank.



22
23
24
25
26
# File 'lib/navfund/providers/union_bank.rb', line 22

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



29
30
31
# File 'lib/navfund/providers/union_bank.rb', line 29

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

#value_atObject



33
34
35
# File 'lib/navfund/providers/union_bank.rb', line 33

def value_at
  uitf_com_ph_date_parser
end