Class: LibWebSocket::OpeningHandshake

Inherits:
Object
  • Object
show all
Defined in:
lib/libwebsocket/opening_handshake.rb,
lib/libwebsocket/opening_handshake/client.rb,
lib/libwebsocket/opening_handshake/server.rb

Overview

This is a base class for LibWebSocket::OpeningHandshake::Client and LibWebSocket::OpeningHandshake::Server.

Direct Known Subclasses

Client, Server

Defined Under Namespace

Classes: Client, Server

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hash = {}) ⇒ OpeningHandshake

Convert all hash keys to instance variables.



11
12
13
14
15
# File 'lib/libwebsocket/opening_handshake.rb', line 11

def initialize(hash = {})
  hash.each do |k,v|
    instance_variable_set("@#{k}",v)
  end
end

Instance Attribute Details

#errorObject

Returns the value of attribute error.



8
9
10
# File 'lib/libwebsocket/opening_handshake.rb', line 8

def error
  @error
end

#secureObject

Returns the value of attribute secure.



8
9
10
# File 'lib/libwebsocket/opening_handshake.rb', line 8

def secure
  @secure
end

Instance Method Details

#reqObject

WebSocket request object.



18
19
20
# File 'lib/libwebsocket/opening_handshake.rb', line 18

def req
  @req ||= Request.new
end

#resObject

WebSocket response object.



23
24
25
# File 'lib/libwebsocket/opening_handshake.rb', line 23

def res
  @res ||= Response.new
end