Class: Amqpop::Message
- Inherits:
-
Object
- Object
- Amqpop::Message
- Defined in:
- lib/amqpop/message.rb
Instance Method Summary collapse
- #ack ⇒ Object
- #callback_proc ⇒ Object
- #command_proc ⇒ Object
- #discard ⇒ Object
-
#initialize(payload, meta) ⇒ Message
constructor
A new instance of Message.
- #requeue ⇒ Object
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 = @payload = payload end |
Instance Method Details
#ack ⇒ Object
9 10 11 |
# File 'lib/amqpop/message.rb', line 9 def ack @meta.ack end |
#callback_proc ⇒ Object
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_proc ⇒ Object
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 |
#discard ⇒ Object
17 18 19 |
# File 'lib/amqpop/message.rb', line 17 def discard @meta.reject(:requeue => false) end |
#requeue ⇒ Object
13 14 15 |
# File 'lib/amqpop/message.rb', line 13 def requeue @meta.reject(:requeue => true) end |