Parent

Methods

Class Index [+]

Quicksearch

AMQ::Client::Framing::String::Frame

Constants

ENCODINGS_SUPPORTED
HEADER_SLICE
DATA_SLICE
PAYLOAD_SLICE

Public Class Methods

decode(string) click to toggle source
    # File lib/amq/client/framing/string/frame.rb, line 39
39:           def self.decode(string)
40:             header              = string[HEADER_SLICE]
41:             type, channel, size = self.decode_header(header)
42:             data                = string[DATA_SLICE]
43:             payload             = data[PAYLOAD_SLICE]
44:             frame_end           = data[1, 1]
45: 
46:             frame_end.force_encoding(AMQ::Protocol::Frame::FINAL_OCTET.encoding) if ENCODINGS_SUPPORTED
47: 
48:             # 1) the size is miscalculated
49:             if payload.bytesize != size
50:               raise BadLengthError.new(size, payload.bytesize)
51:             end
52: 
53:             # 2) the size is OK, but the string doesn't end with FINAL_OCTET
54:             raise NoFinalOctetError.new if frame_end != AMQ::Protocol::Frame::FINAL_OCTET
55: 
56:             self.new(type, payload, channel)
57:           end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.