Class: Polygon::Stream

Inherits:
Object
  • Object
show all
Defined in:
lib/polygon.rb

Overview

Your code goes hereā€¦

Constant Summary collapse

DEFAULT_WATCH =
"MSFT TSLA AAPL AMZN GOOGL BRK.A FB BABA TCEHY JPM JNJ V XOM IDCBF".split(' ')

Instance Method Summary collapse

Constructor Details

#initialize(auth, stream = 'stocks') ⇒ Stream

Returns a new instance of Stream.



22
23
24
# File 'lib/polygon.rb', line 22

def initialize auth, stream='stocks'
  @pi = PolygonInterface.new auth, stream
end

Instance Method Details

#listenObject



26
27
28
29
30
# File 'lib/polygon.rb', line 26

def listen
  @pi.run
  @pi.sub DEFAULT_WATCH
  @pi.thread.join
end