Class: Navfund::ChinaBank

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

Constant Summary collapse

MAIN_URL =

List of funds

"http://www.uitf.com.ph/daily_navpu.php?bank_id=7"
Funds =
[
{:name => "CBC MONEY MARKET FUND", :currency => "PHP", :ticker => ""}, 
{:name => "CBC SHORT-TERM FUND", :currency => "PHP", :ticker => ""},
{:name => "CBC INTERMEDIATE FIXED-INCOME FUND", :currency => "PHP", :ticker => ""},
{:name => "CBC GS FUND", :currency => "PHP", :ticker => ""},
{:name => "CBC BALANCED FUND", :currency => "PHP", :ticker => ""},
{:name => "CBC EQUITY FUND", :currency => "PHP", :ticker => ""},
{:name => "CBC DOLLAR FUND", :currency => "USD", :ticker => ""}
]

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

Returns a new instance of ChinaBank.



17
18
19
20
21
# File 'lib/navfund/providers/china_banking_corporation.rb', line 17

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



24
25
26
# File 'lib/navfund/providers/china_banking_corporation.rb', line 24

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

#value_atObject



28
29
30
# File 'lib/navfund/providers/china_banking_corporation.rb', line 28

def value_at
  uitf_com_ph_date_parser
end