### Home Classes Methods

### In Files

- lib/amqp/header.rb

### Parent

Object

### Methods

- ::new
- #ack
- #consumer_tag
- #content_type
- #correlation_id
- #delivery_mode
- #delivery_tag
- #exchange
- #header
- #headers
- #message_id
- #method_missing
- #priority
- #redelivered
- #redelivered?
- #reject
- #reply_to
- #timestamp
- #to_hash
- #type

### Class/Module Index

Quicksearch

- AMQP
- AMQP::Broker
- AMQP::Channel
- AMQP::ChannelClosedError
- AMQP::Client
- AMQP::Consumer
- AMQP::Error
- AMQP::Exchange
- AMQP::Header
- AMQP::IncompatibleOptionsError
- AMQP::Integration
- AMQP::Integration::Rails
- AMQP::PossibleAuthenticationFailureError
- AMQP::Queue
- AMQP::Session
- AMQP::TCPConnectionFailed
- AMQP::Utilities
- AMQP::Utilities::EventLoopHelper
- AMQP::Utilities::ServerType

No matching classes.

# AMQP::Header

Message metadata (aka envelope).

### Attributes

attributes[R]

AMQP message attributes @return [Hash]

channel[R]

@api public @return [AMQP::Channel]

method[R]

AMQP method frame this header is associated with. Carries additional information that varies between AMQP methods.

@api public @return [AMQ::Protocol::Method]

### Public Class Methods

new(channel, method, attributes) click to toggle source

@api public

    # File lib/amqp/header.rb, line 26
    def initialize(channel, method, attributes)
      @channel, @method, @attributes = channel, method, attributes
    end

### Public Instance Methods

ack(multiple = false) click to toggle source

Acknowledges the receipt of this message with the server. @param [Boolean] multiple Whether or not to acknowledge multiple messages @api public

    # File lib/amqp/header.rb, line 33
    def ack(multiple = false)
      @channel.acknowledge(@method.delivery_tag, multiple)
    end

consumer_tag() click to toggle source

    # File lib/amqp/header.rb, line 54
    def consumer_tag
      @method.consumer_tag
    end

content_type() click to toggle source

    # File lib/amqp/header.rb, line 83
    def content_type
      @attributes[:content_type]
    end

correlation_id() click to toggle source

    # File lib/amqp/header.rb, line 103
    def correlation_id
      @attributes[:correlation_id]
    end

delivery_mode() click to toggle source

    # File lib/amqp/header.rb, line 79
    def delivery_mode
      @attributes[:delivery_mode]
    end

delivery_tag() click to toggle source

    # File lib/amqp/header.rb, line 50
    def delivery_tag
      @method.delivery_tag
    end

exchange() click to toggle source

    # File lib/amqp/header.rb, line 66
    def exchange
      @method.exchange
    end

header() click to toggle source

@deprecated

    # File lib/amqp/header.rb, line 71
    def header
      @attributes
    end

headers() click to toggle source

    # File lib/amqp/header.rb, line 75
    def headers
      @attributes[:headers]
    end

message_id() click to toggle source

    # File lib/amqp/header.rb, line 107
    def message_id
      @attributes[:message_id]
    end

method_missing(meth, *args, &blk) click to toggle source

Returns AMQP message attributes. @api public

    # File lib/amqp/header.rb, line 114
    def method_missing(meth, *args, &blk)
      if @attributes && args.empty? && blk.nil? && @attributes.has_key?(meth)
        @attributes[meth]
      else
        @method.__send__(meth, *args, &blk)
      end
    end

priority() click to toggle source

    # File lib/amqp/header.rb, line 95
    def priority
      @attributes[:priority]
    end

redelivered() click to toggle source

    # File lib/amqp/header.rb, line 58
    def redelivered
      @method.redelivered
    end

redelivered?() click to toggle source

    # File lib/amqp/header.rb, line 62
    def redelivered?
      @method.redelivered
    end

reject(opts = {}) click to toggle source

Reject this message. @option opts [Hash] :requeue (false) Whether message should be requeued. @api public

    # File lib/amqp/header.rb, line 40
    def reject(opts = {})
      @channel.reject(@method.delivery_tag, opts.fetch(:requeue, false))
    end

reply_to() click to toggle source

    # File lib/amqp/header.rb, line 99
    def reply_to
      @attributes[:reply_to]
    end

timestamp() click to toggle source

    # File lib/amqp/header.rb, line 87
    def timestamp
      @attributes[:timestamp]
    end

to_hash() click to toggle source

@return [Hash] AMQP message header w/o method-specific information. @api public

    # File lib/amqp/header.rb, line 46
    def to_hash
      @attributes
    end

type() click to toggle source

    # File lib/amqp/header.rb, line 91
    def type
      @attributes[:type]
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.