Class: Carrot::AMQP::Header

Inherits:
Object
  • Object
show all
Defined in:
lib/amqp/header.rb

Instance Method Summary collapse

Constructor Details

#initialize(server, header_obj) ⇒ Header

Returns a new instance of Header.



3
4
5
6
# File 'lib/amqp/header.rb', line 3

def initialize(server, header_obj)
  @server = server
  @header = header_obj
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(meth, *args, &blk) ⇒ Object



19
20
21
# File 'lib/amqp/header.rb', line 19

def method_missing(meth, *args, &blk)
  @header.send(meth, *args, &blk)
end

Instance Method Details

#ackObject

Acknowledges the receipt of this message with the server.



9
10
11
# File 'lib/amqp/header.rb', line 9

def ack
  @server.send(Protocol::Basic::Ack.new(:delivery_tag => properties[:delivery_tag]))
end

#inspectObject



23
24
25
# File 'lib/amqp/header.rb', line 23

def inspect
  @header.inspect
end

#reject(opts = {}) ⇒ Object

Reject this message (XXX currently unimplemented in rabbitmq)

  • :requeue => true | false (default false)



15
16
17
# File 'lib/amqp/header.rb', line 15

def reject(opts = {})
  @server.send(Protocol::Basic::Reject.new(opts.merge(:delivery_tag => properties[:delivery_tag])))
end