Class: LSQS::Actions::DeleteMessageBatch
- Defined in:
- lib/lsqs/actions/delete_message_batch.rb
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#perform(params) ⇒ String
Performs the specific action.
Methods inherited from Base
#build_url, #initialize, #name, #to_xml
Constructor Details
This class inherits a constructor from LSQS::Actions::Base
Instance Method Details
#perform(params) ⇒ String
Performs the specific action.
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/lsqs/actions/delete_message_batch.rb', line 11 def perform(params) name = params['QueueName'] queue = queue_list.find(name) queue = queue_list.find(name) receipts = params.select do |key, value| key.match(/DeleteMessageBatchRequestEntry\.\d+\.ReceiptHandle/) end deleted = [] receipts.each do |key, value| id = key.split('.')[1] queue.(value) deleted << params["DeleteMessageBatchRequestEntry.#{id}.Id"] end deleted.compact.each do |id| builder.DeleteMessageBatchResultEntry do builder.Id id end end end |