Class: Navfund::ATRAM

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

Constant Summary collapse

MAIN_URL =

List of funds

"http://www.uitf.com.ph/daily_navpu.php?bank_id=31"
Funds =
[
{:name => "ATRAM Peso Money Market Fund", :currency => "PHP", :ticker => "ATRPHMM:PM"}, 
{:name => "ATRAM Total Return Peso Bond Fund", :currency => "PHP", :ticker => "ATRPHFI:PM"},
{:name => "ATRAM Emerging Markets Bond Feeder Fund", :currency => "USD", :ticker => "ATREMFI:PM"},
{:name => "ATRAM Global Total Return Bond Feeder Fund", :currency => "USD", :ticker => "ATRGLFI:PM"},
{:name => "ATRAM Global Allocation Feeder Fund", :currency => "USD", :ticker => "ATRGLAA:PM"},
{:name => "ATRAM Emerging Markets Equity Opportunity Feeder Fund", :currency => "USD", :ticker => "ATREMEQ:PM"},
{:name => "ATRAM European Equity Opportunity Feeder Fund", :currency => "USD", :ticker => "ATREUEQ:PM"},
{:name => "ATRAM Global Equity Opportunity Feeder Fund", :currency => "USD", :ticker => "ATRGLEQ: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) ⇒ ATRAM

Returns a new instance of ATRAM.



18
19
20
21
22
# File 'lib/navfund/providers/atram.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/atram.rb', line 25

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

#value_atObject



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

def value_at
  uitf_com_ph_date_parser
end