Class: Amqpop::Message

Inherits:
Object
  • Object
show all
Defined in:
lib/amqpop/message.rb

Instance Method Summary collapse

Constructor Details

#initialize(payload, meta) ⇒ Message

Returns a new instance of Message.



4
5
6
7
# File 'lib/amqpop/message.rb', line 4

def initialize(payload, meta)
	@meta = meta
	@payload = payload
end

Instance Method Details

#ackObject



9
10
11
# File 'lib/amqpop/message.rb', line 9

def ack
	@meta.ack
end

#callback_procObject



29
30
31
32
33
34
35
# File 'lib/amqpop/message.rb', line 29

def callback_proc
	if child_command_set?
		process_callback_proc
	else
		plain_callback_proc
	end
end

#command_procObject



21
22
23
24
25
26
27
# File 'lib/amqpop/message.rb', line 21

def command_proc
	if child_command_set?
		process_command_proc
	else
		plain_command_proc
	end
end

#discardObject



17
18
19
# File 'lib/amqpop/message.rb', line 17

def discard
	@meta.reject(:requeue => false)
end

#requeueObject



13
14
15
# File 'lib/amqpop/message.rb', line 13

def requeue
	@meta.reject(:requeue => true)
end