Class: Navfund::SecurityBank

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

Constant Summary collapse

MAIN_URL =

List of funds

"http://www.uitf.com.ph/daily_navpu.php?bank_id=12"
Funds =
[
{:name => "SB PESO MONEY MARKET FUND", :currency => "PHP", :ticker => "SBPSOEA:PM"}, 
{:name => "SB Intermediate Term Peso Bond Fund", :currency => "PHP", :ticker => "SBITPBD:PM"},
{:name => "SB PESO BOND FUND", :currency => "PHP", :ticker => "SBPSUIT:PM"},
{:name => "SB TAX-EXEMPT BOND FUND", :currency => "PHP", :ticker => "SBTEXBD:PM"},
{:name => "SB PESO ASSET VARIETY FUND", :currency => "PHP", :ticker => "SBPSASV:PM"},
{:name => "SB HIGH DIVIDEND PESO EQUITY FUND", :currency => "PHP", :ticker => "SBPSHDF:PM"},
{:name => "SB PESO EQUITY FUND", :currency => "PHP", :ticker => "SBPSEQF:PM"},
{:name => "SB DOLLAR BOND FUND", :currency => "USD", :ticker => "SBDLUIT: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) ⇒ SecurityBank

Returns a new instance of SecurityBank.



18
19
20
21
22
# File 'lib/navfund/providers/security_bank.rb', line 18

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



25
26
27
# File 'lib/navfund/providers/security_bank.rb', line 25

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

#value_atObject



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

def value_at
  uitf_com_ph_date_parser
end