Class: Protocol

Inherits:
Object show all
Defined in:
lib/cocaine/protocol.rb

Direct Known Subclasses

Choke, Chunk, Error, Handshake, Heartbeat, Invoke, Terminate

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



17
18
19
# File 'lib/cocaine/protocol.rb', line 17

def id
  @id
end

Instance Method Details

#pack(session) ⇒ Object



19
20
21
# File 'lib/cocaine/protocol.rb', line 19

def pack(session)
  [@id, session, content].to_msgpack
end

#to_sObject



23
24
25
# File 'lib/cocaine/protocol.rb', line 23

def to_s
  "#{self.class.name}(#{content})"
end