Class: SocketIo::Packet::EventPacket

Inherits:
SocketIo::Packet show all
Defined in:
lib/socket.io/packet/event_packet.rb

Constant Summary

Constants inherited from SocketIo::Packet

PACKET_REGEX, PACKET_TYPES

Instance Attribute Summary

Attributes inherited from SocketIo::Packet

#ack, #data, #endpoint, #id

Instance Method Summary collapse

Methods inherited from SocketIo::Packet

#ackdata?, #initialize, #json, parse, parse_json

Constructor Details

This class inherits a constructor from SocketIo::Packet

Instance Method Details

#argsObject



10
11
12
# File 'lib/socket.io/packet/event_packet.rb', line 10

def args
  json['args'] || []
end

#nameObject



6
7
8
# File 'lib/socket.io/packet/event_packet.rb', line 6

def name
  json['name']
end

#to_sObject



16
17
18
19
20
21
22
23
24
# File 'lib/socket.io/packet/event_packet.rb', line 16

def to_s
  ev = { 'name' => name }

  if args && args.length
    ev['args'] = args
  end

  super ev.to_json;
end

#type_idObject



14
# File 'lib/socket.io/packet/event_packet.rb', line 14

def type_id; 5; end