Sha256: 38a1e2a0bcf8330ad2e5b65d4ddd7a2438a5079fdd3602504a527605a1b41847

Contents?: true

Size: 634 Bytes

Versions: 1

Compression:

Stored size: 634 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)
        @responder.call :SetQueueAttributes
      end

    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
fake_sqs-0.0.9 lib/fake_sqs/actions/set_queue_attributes.rb