Class: Yafa::StockQuotes
- Inherits:
-
Object
- Object
- Yafa::StockQuotes
- Defined in:
- lib/yafa/stock_quotes.rb
Constant Summary collapse
- BATCHLIMIT_QUOTES =
400
- READ_TIMEOUT =
10
- YAHOO_API_START =
'https://query.yahooapis.com/'.freeze
- YAHOO_API_QUERY =
'v1/public/yql?q=SELECT * FROM yahoo.finance.quotes'\ ' WHERE symbol IN (yahoo_tickers)'.freeze
- YAHOO_API_END =
'&format=json&diagnostics=true&env=store%3A%2F%2Fdatata'\ 'bles.org%2Falltableswithkeys&callback='.freeze
Instance Method Summary collapse
- #fetch ⇒ Object
-
#initialize(tickers) ⇒ StockQuotes
constructor
A new instance of StockQuotes.
Constructor Details
#initialize(tickers) ⇒ StockQuotes
Returns a new instance of StockQuotes.
16 17 18 |
# File 'lib/yafa/stock_quotes.rb', line 16 def initialize(tickers) @tickers = tickers end |
Instance Method Details
#fetch ⇒ Object
20 21 22 23 24 25 |
# File 'lib/yafa/stock_quotes.rb', line 20 def fetch formatted_tickers = format_tickers @tickers quote_data = call_api(formatted_tickers) format_quote_data(quote_data) end |