Class: E4z::SocketClient
- Inherits:
-
Object
- Object
- E4z::SocketClient
- Defined in:
- lib/socket_client.rb
Instance Method Summary collapse
-
#initialize(project_slug) ⇒ SocketClient
constructor
A new instance of SocketClient.
- #options ⇒ Object
- #socket ⇒ Object
Constructor Details
#initialize(project_slug) ⇒ SocketClient
5 6 7 8 9 10 11 12 13 14 |
# File 'lib/socket_client.rb', line 5 def initialize(project_slug) @project_slug = project_slug socket.subscribe(@project_slug) socket[@project_slug].bind('run_instruction') do |data| yield(data) end socket.connect end |
Instance Method Details
#options ⇒ Object
16 17 18 |
# File 'lib/socket_client.rb', line 16 def { secure: true } end |
#socket ⇒ Object
20 21 22 |
# File 'lib/socket_client.rb', line 20 def socket @socket ||= PusherClient::Socket.new(ENV['PUSHER_TOKEN'], ) end |