Class: Navfund::AsiaUnitedBank

Inherits:
Provider
  • Object
show all
Defined in:
lib/navfund/providers/asia_united_bank.rb

Constant Summary collapse

MAIN_URL =

List of funds

"http://www.uitf.com.ph/daily_navpu.php?bank_id=4"
Funds =
[
{:name => "Peso Money Market Fund", :currency => "PHP", :ticker => ""}, 
{:name => "Peso Investment Trust Fund", :currency => "PHP", :ticker => "AUBPPIF:PM"},
{:name => "Equity Investment Trust Fund", :currency => "PHP", :ticker => "AUBBEIF:PM"},
{:name => "Gold Dollar Fund", :currency => "USD", :ticker => "AUBBGDF: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) ⇒ AsiaUnitedBank

Returns a new instance of AsiaUnitedBank.



14
15
16
17
18
# File 'lib/navfund/providers/asia_united_bank.rb', line 14

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



21
22
23
# File 'lib/navfund/providers/asia_united_bank.rb', line 21

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

#value_atObject



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

def value_at
  uitf_com_ph_date_parser
end