lib/amqp/header.rb in amqp-0.8.0.rc2 vs lib/amqp/header.rb in amqp-0.8.0.rc3
- old
+ new
@@ -36,17 +36,21 @@
# @api public
def reject(opts = {})
@channel.reject(@method.delivery_tag, opts.fetch(:requeue, false))
end
+ # @return [Hash] AMQP message header w/o method-specific information.
+ # @api public
def to_hash
@header
end # to_hash
def respond_to_missing?(meth, _)
(@header && args.empty? && blk.nil? && @header.has_key?(meth)) || @method.respond_to?(meth)
end
+ # Returns AMQP message attributes.
+ # @api public
def method_missing(meth, *args, &blk)
if @header && args.empty? && blk.nil? && @header.has_key?(meth)
@header[meth]
else
@method.__send__(meth, *args, &blk)