Sha256: 51fe0ca260329a664dbce17df2cbb36ca91fb630e650dbdef977494699c9ba77

Contents?: true

Size: 662 Bytes

Versions: 10

Compression:

Stored size: 662 Bytes

Contents

module FakeSQS
  module Actions
    class SetQueueAttributes

      def initialize(options = {})
        @server    = options.fetch(:server)
        @queues    = options.fetch(:queues)
        @responder = options.fetch(:responder)
      end

      def call(queue_name, params)
        queue = @queues.get(queue_name)
        results = {}
        params.each do |key, value|
          if key =~ /\AAttribute\.(\d+)\.Name\z/
            results[value] = params.fetch("Attribute.#{$1}.Value")
          end
        end
        queue.add_queue_attributes(results)
        @queues.save(queue)
        @responder.call :SetQueueAttributes
      end

    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
fake_sqs-0.4.3 lib/fake_sqs/actions/set_queue_attributes.rb
fake_sqs-0.4.2 lib/fake_sqs/actions/set_queue_attributes.rb
fake_sqs-0.4.1 lib/fake_sqs/actions/set_queue_attributes.rb
fake_sqs-0.4.0 lib/fake_sqs/actions/set_queue_attributes.rb
fake_sqs-0.3.1 lib/fake_sqs/actions/set_queue_attributes.rb
fake_sqs-0.3.0 lib/fake_sqs/actions/set_queue_attributes.rb
fake_sqs-0.2.0 lib/fake_sqs/actions/set_queue_attributes.rb
fake_sqs-0.1.0 lib/fake_sqs/actions/set_queue_attributes.rb
fake_sqs-0.0.11 lib/fake_sqs/actions/set_queue_attributes.rb
fake_sqs-0.0.10 lib/fake_sqs/actions/set_queue_attributes.rb