Class: AMQ::Protocol::FrameSubclass
- Defined in:
- lib/amq/protocol/frame.rb
Direct Known Subclasses
Constant Summary
Constants inherited from Frame
AMQ::Protocol::Frame::CHANNEL_RANGE, AMQ::Protocol::Frame::CLASSES, AMQ::Protocol::Frame::FINAL_OCTET, AMQ::Protocol::Frame::TYPES, AMQ::Protocol::Frame::TYPES_OPTIONS, AMQ::Protocol::Frame::TYPES_REVERSE
Instance Attribute Summary collapse
-
#channel ⇒ Object
Returns the value of attribute channel.
-
#payload ⇒ Object
readonly
Returns the value of attribute payload.
Class Method Summary collapse
Instance Method Summary collapse
- #encode ⇒ Object
-
#initialize(payload, channel) ⇒ FrameSubclass
constructor
A new instance of FrameSubclass.
- #size ⇒ Object
Methods inherited from Frame
#__new__, decode, decode_header, #final?, find_type
Constructor Details
#initialize(payload, channel) ⇒ FrameSubclass
Returns a new instance of FrameSubclass.
75 76 77 |
# File 'lib/amq/protocol/frame.rb', line 75 def initialize(payload, channel) @payload, @channel = payload, channel end |
Instance Attribute Details
#channel ⇒ Object
Returns the value of attribute channel.
73 74 75 |
# File 'lib/amq/protocol/frame.rb', line 73 def channel @channel end |
#payload ⇒ Object (readonly)
Returns the value of attribute payload.
74 75 76 |
# File 'lib/amq/protocol/frame.rb', line 74 def payload @payload end |
Class Method Details
.encode(payload, channel) ⇒ Object
69 70 71 |
# File 'lib/amq/protocol/frame.rb', line 69 def self.encode(payload, channel) super(@id, payload, channel) end |
.id ⇒ Object
65 66 67 |
# File 'lib/amq/protocol/frame.rb', line 65 def self.id @id end |
Instance Method Details
#encode ⇒ Object
83 84 85 |
# File 'lib/amq/protocol/frame.rb', line 83 def encode [self.class.id, @channel, self.size].pack(PACK_CHAR_UINT16_UINT32) + @payload.bytes.to_a.pack(SIMPLE_BYTE_PACK) + FINAL_OCTET end |
#size ⇒ Object
79 80 81 |
# File 'lib/amq/protocol/frame.rb', line 79 def size @payload.bytesize end |