class FakeSQS::Actions::ListDeadLetterSourceQueues
Public Class Methods
new(options = {})
click to toggle source
# File lib/fake_sqs/actions/list_dead_letter_source_queues.rb, line 5 def initialize(options = {}) @server = options.fetch(:server) @queues = options.fetch(:queues) @responder = options.fetch(:responder) end
Public Instance Methods
call(queue_name, params)
click to toggle source
# 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