Parent

Class Index [+]

Quicksearch

AMQ::Protocol::Method

Public Class Methods

encode_body(body, channel, frame_size) click to toggle source
     # File lib/amq/protocol/client.rb, line 246
246:       def self.encode_body(body, channel, frame_size)
247:         return [] if body.empty?
248: 
249:         # See https://dev.rabbitmq.com/wiki/Amqp091Errata#section_11
250:         limit        = frame_size - 8
251:         limit_plus_1 = limit + 1
252: 
253:         array = Array.new
254:         while body
255:           payload, body = body[0, limit_plus_1], body[limit_plus_1, body.length - limit]
256:           # array << [0x03, payload]
257:           array << BodyFrame.new(payload, channel)
258:         end
259: 
260:         array
261:       end
index() click to toggle source
     # File lib/amq/protocol/client.rb, line 218
218:       def self.index
219:         @index
220:       end
inherited(base) click to toggle source
     # File lib/amq/protocol/client.rb, line 222
222:       def self.inherited(base)
223:         if self == Protocol::Method
224:           @methods << base
225:         end
226:       end
instantiate(*args, &block) click to toggle source

We can return different:

  • instantiate given subclass of Method

  • create an OpenStruct object

  • create a hash

  • yield params into the block rather than just return

@api plugin

     # File lib/amq/protocol/client.rb, line 269
269:       def self.instantiate(*args, &block)
270:         self.new(*args, &block)
271:         # or OpenStruct.new(args.first)
272:         # or args.first
273:         # or block.call(*args)
274:       end
method_id() click to toggle source
     # File lib/amq/protocol/client.rb, line 210
210:       def self.method_id
211:         @method_id
212:       end
methods() click to toggle source
     # File lib/amq/protocol/client.rb, line 228
228:       def self.methods
229:         @methods
230:       end
name() click to toggle source
     # File lib/amq/protocol/client.rb, line 214
214:       def self.name
215:         @name
216:       end
split_headers(user_headers) click to toggle source
     # File lib/amq/protocol/client.rb, line 232
232:       def self.split_headers(user_headers)
233:         properties, headers = {}, {}
234:         user_headers.each do |key, value|
235:           # key MUST be a symbol since symbols are not garbage-collected
236:           if Basic::PROPERTIES.include?(key)
237:             properties[key] = value
238:           else
239:             headers[key] = value
240:           end
241:         end
242: 
243:         return [properties, headers]
244:       end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.