Module: Faye::WebSocket::Adapter

Included in:
RainbowsClient, Goliath::API, Thin::Request
Defined in:
lib/faye/websocket/adapter.rb

Instance Method Summary collapse

Instance Method Details

#eventsource?Boolean

Returns:

  • (Boolean)


10
11
12
13
# File 'lib/faye/websocket/adapter.rb', line 10

def eventsource?
  e = defined?(@env) ? @env : env
  e && EventSource.eventsource?(e)
end

#socket_connection?Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/faye/websocket/adapter.rb', line 15

def socket_connection?
  websocket? or eventsource?
end

#websocket?Boolean

Returns:

  • (Boolean)


5
6
7
8
# File 'lib/faye/websocket/adapter.rb', line 5

def websocket?
  e = defined?(@env) ? @env : env
  e && WebSocket.websocket?(e)
end