Class: AMQ::Protocol::HeaderFrame

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, id, #initialize, #size

Methods inherited from Frame

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

Constructor Details

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

Instance Method Details

#body_sizeObject



114
115
116
117
# File 'lib/amq/protocol/frame.rb', line 114

def body_size
  decode_payload
  @body_size
end

#decode_payloadObject



134
135
136
137
138
139
140
141
142
143
144
# File 'lib/amq/protocol/frame.rb', line 134

def decode_payload
  @decoded_payload ||= begin
                         @klass_id, @weight = @payload.unpack(PACK_UINT16_X2)
                         # the total size of the content body, that is, the sum of the body sizes for the
                         # following content body frames. Zero indicates that there are no content body frames.
                         # So this is NOT related to this very header frame!
                         @body_size         = AMQ::Hacks.unpack_64_big_endian(@payload[4..11]).first
                         @data              = @payload[12..-1]
                         @properties        = Basic.decode_properties(@data)
                       end
end

#final?Boolean

Returns:

  • (Boolean)


110
111
112
# File 'lib/amq/protocol/frame.rb', line 110

def final?
  false
end

#klass_idObject



124
125
126
127
# File 'lib/amq/protocol/frame.rb', line 124

def klass_id
  decode_payload
  @klass_id
end

#propertiesObject



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

def properties
  decode_payload
  @properties
end

#weightObject



119
120
121
122
# File 'lib/amq/protocol/frame.rb', line 119

def weight
  decode_payload
  @weight
end