Class: FakeSQS::Actions::ListDeadLetterSourceQueues
- Inherits:
-
Object
- Object
- FakeSQS::Actions::ListDeadLetterSourceQueues
- Defined in:
- lib/fake_sqs/actions/list_dead_letter_source_queues.rb
Instance Method Summary collapse
- #call(queue_name, params) ⇒ Object
-
#initialize(options = {}) ⇒ ListDeadLetterSourceQueues
constructor
A new instance of ListDeadLetterSourceQueues.
Constructor Details
#initialize(options = {}) ⇒ ListDeadLetterSourceQueues
Returns a new instance of ListDeadLetterSourceQueues.
5 6 7 8 9 |
# File 'lib/fake_sqs/actions/list_dead_letter_source_queues.rb', line 5 def initialize( = {}) @server = .fetch(:server) @queues = .fetch(:queues) @responder = .fetch(:responder) end |
Instance Method Details
#call(queue_name, params) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/fake_sqs/actions/list_dead_letter_source_queues.rb', line 11 def call(queue_name, params) queue_arn = @queues.get(queue_name).arn queue_urls = @queues.list.select do |queue| redrive_policy = queue.attributes.fetch("RedrivePolicy", nil) redrive_policy && redrive_policy =~ /deadLetterTargetArn\":\"#{queue_arn}/ end @responder.call :ListDeadLetterSourceQueues do |xml| queue_urls.each do |queue| xml.QueueUrl @server.url_for(queue.name) end end end |