Class: IronMQ::Message

Inherits:
ResponseBase show all
Defined in:
lib/iron_mq/messages.rb

Instance Method Summary collapse

Methods inherited from ResponseBase

#[], #id, #msg, #raw

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(messages, res, options={})
  super(res)
  @messages = messages
  @options = options
end

Instance Method Details

#bodyObject



108
109
110
# File 'lib/iron_mq/messages.rb', line 108

def body
  raw["body"]
end

#deleteObject



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(options={})
  options2 = options || {}
  options2 = options.merge(@options) if @options
  @messages.release(self.id, options2)
end