class AMQ::Protocol::Connection::Close
Attributes
class_id[R]
method_id[R]
reply_code[R]
reply_text[R]
Public Class Methods
decode(data)
click to toggle source
@return
# File lib/amq/protocol/client.rb, line 441 def self.decode(data) offset = 0 reply_code = data[offset, 2].unpack(PACK_UINT16).first offset += 2 length = data[offset, 1].unpack(PACK_CHAR).first offset += 1 reply_text = data[offset, length] offset += length class_id = data[offset, 2].unpack(PACK_UINT16).first offset += 2 method_id = data[offset, 2].unpack(PACK_UINT16).first offset += 2 self.new(reply_code, reply_text, class_id, method_id) end
encode(reply_code, reply_text, class_id, method_id)
click to toggle source
@return
- u'reply_code = nil', u'reply_text = EMPTY_STRING', u'class_id = nil', u'method_id = nil'
# File lib/amq/protocol/client.rb, line 470 def self.encode(reply_code, reply_text, class_id, method_id) channel = 0 buffer = @packed_indexes.dup buffer << [reply_code].pack(PACK_UINT16) buffer << reply_text.to_s.bytesize.chr buffer << reply_text.to_s buffer << [class_id].pack(PACK_UINT16) buffer << [method_id].pack(PACK_UINT16) MethodFrame.new(buffer, channel) end
has_content?()
click to toggle source
# File lib/amq/protocol/client.rb, line 464 def self.has_content? false end
new(reply_code, reply_text, class_id, method_id)
click to toggle source
# File lib/amq/protocol/client.rb, line 457 def initialize(reply_code, reply_text, class_id, method_id) @reply_code = reply_code @reply_text = reply_text @class_id = class_id @method_id = method_id end