Commit 5c9e7ae
Changed files (1)
lib
service
lib/service/stock_service.rb
@@ -1,12 +1,11 @@
class StockService
+ API_URL = 'http://download.finance.yahoo.com/d/quotes.csv'
def initialize(http_gateway = HttpGateway.new)
@http_gateway = http_gateway
end
- #http://download.finance.yahoo.com/d/quotes.csv?s=%40%5EDJI,GOOG&f=nsl1op&e=.csv
def fetch(symbol)
- #map_from(@http_gateway.get('http://download.finance.yahoo.com/d/quotes.csv', {s: 'GOOG', f: 'nsl1', e: '.csv'}))
- map_from(@http_gateway.get('http://download.finance.yahoo.com/d/quotes.csv', {s: symbol, f: 'nsl1', e: '.csv'}))
+ map_from(@http_gateway.get(API_URL, {s: symbol, f: 'nsl1', e: '.csv'}))
end
private