Class: Navfund::ChinaBankSavings
- Defined in:
- lib/navfund/providers/china_bank_savings.rb
Constant Summary collapse
- MAIN_URL =
List of funds
"http://www.uitf.com.ph/daily_navpu.php?bank_id=35"
- Funds =
[ {:name => "CBS MONEY MANAGER FUND", :currency => "PHP", :ticker => ""}, {:name => "CBS ASSET BUILDER FUND", :currency => "PHP", :ticker => ""}, {:name => "CBS PESO BALANCED VALUE FUND", :currency => "PHP", :ticker => ""}, {:name => "US DOLLAR PREMIUM FUND", :currency => "USD", :ticker => ""} ]
Instance Attribute Summary
Attributes inherited from Provider
Instance Method Summary collapse
-
#initialize(main_url = nil) ⇒ ChinaBankSavings
constructor
A new instance of ChinaBankSavings.
-
#value(fund, fund_type = nil) ⇒ Object
Fetch the current value.
- #value_at ⇒ Object
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) ⇒ ChinaBankSavings
Returns a new instance of ChinaBankSavings.
14 15 16 17 18 |
# File 'lib/navfund/providers/china_bank_savings.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/china_bank_savings.rb', line 21 def value(fund, fund_type=nil) uitf_com_ph_parser(fund) end |
#value_at ⇒ Object
25 26 27 |
# File 'lib/navfund/providers/china_bank_savings.rb', line 25 def value_at uitf_com_ph_date_parser end |