Class: SocketIo::Packet::ErrorPacket
Constant Summary
collapse
- REASONS =
['transport not supported', 'client not handshaken', 'unauthorized']
- ADVICE =
%w{reconnect}
PACKET_REGEX, PACKET_TYPES
Instance Attribute Summary
#ack, #data, #endpoint, #id
Instance Method Summary
collapse
#ackdata?, #initialize, #json, parse, parse_json
Instance Method Details
#from_pieces(pieces) ⇒ Object
7
8
9
10
11
|
# File 'lib/socket.io/packet/error_packet.rb', line 7
def from_pieces(pieces)
sub_pieces = data.split('+');
self.reason = REASONS[sub_pieces[0]] || '';
self.advice = ADVICE[sub_pieces[1]] || '';
end
|
#to_s ⇒ Object
15
16
17
18
19
20
21
|
# File 'lib/socket.io/packet/error_packet.rb', line 15
def to_s
payload = nil
if reason != '' || advice != ''
payload = reason + (advice != '' ? ('+' + advice) : '')
end
super payload
end
|
#type_id ⇒ Object
13
|
# File 'lib/socket.io/packet/error_packet.rb', line 13
def type_id; 7; end
|