Class: IronMQ::Message
- Inherits:
-
ResponseBase
- Object
- ResponseBase
- IronMQ::Message
- Defined in:
- lib/iron_mq/messages.rb
Instance Method Summary collapse
- #body ⇒ Object
- #delete ⇒ Object
-
#initialize(messages, res, options = {}) ⇒ Message
constructor
A new instance of Message.
- #release(options = {}) ⇒ Object
Methods inherited from ResponseBase
Constructor Details
#initialize(messages, res, options = {}) ⇒ Message
Returns a new instance of Message.
101 102 103 104 105 |
# File 'lib/iron_mq/messages.rb', line 101 def initialize(, res, ={}) super(res) @messages = @options = end |
Instance Method Details
#body ⇒ Object
108 109 110 |
# File 'lib/iron_mq/messages.rb', line 108 def body raw["body"] end |
#delete ⇒ Object
112 113 114 |
# File 'lib/iron_mq/messages.rb', line 112 def delete @messages.delete(self.id, @options) end |
#release(options = {}) ⇒ Object
116 117 118 119 120 |
# File 'lib/iron_mq/messages.rb', line 116 def release(={}) = || {} = .merge(@options) if @options @messages.release(self.id, ) end |