Class: AMQ::Protocol::MethodFrame

Inherits:
FrameSubclass show all
Defined in:
lib/amq/protocol/frame.rb

Constant Summary

Constants inherited from Frame

Frame::CHANNEL_RANGE, Frame::CLASSES, Frame::FINAL_OCTET, Frame::TYPES, Frame::TYPES_OPTIONS, Frame::TYPES_REVERSE

Instance Attribute Summary

Attributes inherited from FrameSubclass

#channel, #payload

Instance Method Summary collapse

Methods inherited from FrameSubclass

#encode, encode, #encode_to_array, id, #initialize, #size

Methods inherited from Frame

#__new__, decode, decode_header, encode, encode_to_array, encoded_payload, find_type, new

Constructor Details

This class inherits a constructor from AMQ::Protocol::FrameSubclass

Instance Method Details

#decode_payloadObject

final?



132
133
134
# File 'lib/amq/protocol/frame.rb', line 132

def decode_payload
  self.method_class.decode(@payload[4..-1])
end

#final?Boolean

Returns:

  • (Boolean)


128
129
130
# File 'lib/amq/protocol/frame.rb', line 128

def final?
  !self.method_class.has_content?
end

#method_classObject



120
121
122
123
124
125
126
# File 'lib/amq/protocol/frame.rb', line 120

def method_class
  @method_class ||= begin
                      klass_id, method_id = self.payload.unpack(PACK_UINT16_X2)
                      index               = klass_id << 16 | method_id
                      AMQ::Protocol::METHODS[index]
                    end
end