class AMQ::Protocol::Connection::UpdateSecret
Attributes
new_secret[R]
reason[R]
Public Class Methods
decode(data)
click to toggle source
@return
# File lib/amq/protocol/client.rb, line 586 def self.decode(data) offset = offset = 0 # self-assigning offset to eliminate "assigned but unused variable" warning even if offset is not used in this method length = data[offset, 4].unpack(PACK_UINT32).first offset += 4 new_secret = data[offset, length] offset += length length = data[offset, 1].unpack(PACK_CHAR).first offset += 1 reason = data[offset, length] offset += length self.new(new_secret, reason) end
encode(new_secret, reason)
click to toggle source
@return
- u'new_secret = nil', u'reason = nil'
# File lib/amq/protocol/client.rb, line 611 def self.encode(new_secret, reason) channel = 0 buffer = @packed_indexes.dup buffer << [new_secret.to_s.bytesize].pack(PACK_UINT32) buffer << new_secret.to_s buffer << reason.to_s.bytesize.chr buffer << reason.to_s MethodFrame.new(buffer, channel) end
has_content?()
click to toggle source
# File lib/amq/protocol/client.rb, line 605 def self.has_content? false end
new(new_secret, reason)
click to toggle source
# File lib/amq/protocol/client.rb, line 600 def initialize(new_secret, reason) @new_secret = new_secret @reason = reason end