lib/yahoo-finance/finance-utils.rb in yahoo-finance-1.2.0 vs lib/yahoo-finance/finance-utils.rb in yahoo-finance-1.2.1
- old
+ new
@@ -15,11 +15,12 @@
amex: OpenStruct.new(
url: "http://www.nasdaq.com/screening/companies-by-name.aspx?letter=0&exchange=amex&render=download")))
def symbols_by_market(country, market)
symbols = []
- return symbols unless MARKETS[country][market]
- CSV.foreach(open(MARKETS[country][market].url)) do |row|
+ market = MARKETS.send(country).send(market)
+ return symbols if market.nil?
+ CSV.foreach(open(market.url)) do |row|
next if row.first == "Symbol"
symbols.push(row.first.gsub(" ", ""))
end
symbols
end