class WebSocket::Handshake::Handler::Base
This class and it’s descendants are included in client or server handshake in order to extend basic functionality
Public Class Methods
Source
# File lib/websocket/handshake/handler/base.rb, line 8 def initialize(handshake) @handshake = handshake end
Public Instance Methods
Source
# File lib/websocket/handshake/handler/base.rb, line 13 def to_s result = [header_line] handshake_keys.each do |key| result << key.join(': ') end result << '' result << finishing_line result.join("\r\n") end
Private Instance Methods
Source
# File lib/websocket/handshake/handler/base.rb, line 43 def finishing_line '' end
Set data to send after headers. In most cases it will be blank data. @return [String] data
Source
# File lib/websocket/handshake/handler/base.rb, line 37 def handshake_keys [] end
Set handshake headers. Provided as array because some protocol version require specific order of fields. @return [Array] List of headers as arrays [key, value]
Source
# File lib/websocket/handshake/handler/base.rb, line 31 def header_line '' end
Set first line of text representation according to specification. @return [String] First line of HTTP header