Class: Webmate::SocketIO::Actions::Handshake
- Inherits:
-
Object
- Object
- Webmate::SocketIO::Actions::Handshake
- Defined in:
- lib/webmate/socket.io/actions/handshake.rb
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Handshake
constructor
A new instance of Handshake.
- #respond ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Handshake
Returns a new instance of Handshake.
5 6 7 8 9 10 11 12 13 14 |
# File 'lib/webmate/socket.io/actions/handshake.rb', line 5 def initialize( = {}) @session_id = generate_session_id = { transports: %w{websocket}, heartbeat_timeout: 300, closing_timeout: 300 } @settings = OpenStruct.new(.merge()) end |
Instance Method Details
#respond ⇒ Object
16 17 18 19 20 21 22 23 24 |
# File 'lib/webmate/socket.io/actions/handshake.rb', line 16 def respond body = [ @session_id, @settings.heartbeat_timeout, @settings.closing_timeout, @settings.transports.join(',') ] Webmate::Responders::Response.new(body.join(':')) end |