Class: Async::Slack::RealTime

Inherits:
Representation show all
Defined in:
lib/async/slack/real_time.rb

Instance Method Summary collapse

Methods inherited from Representation

#initialize

Constructor Details

This class inherits a constructor from Async::Slack::Representation

Instance Method Details

#connect(&block) ⇒ Object



31
32
33
34
35
36
37
38
39
40
# File 'lib/async/slack/real_time.rb', line 31

def connect(&block)
	response = self.post
	
	parameters = response.read
	url = parameters[:url]
	
	endpoint = Async::HTTP::Endpoint.parse(url)
	
	Async::WebSocket::Client.connect(endpoint, &block)
end