Sha256: 5f4b451aaaab5555869a06bff88c303891d17d2c856eb85220f1345434e2a27e

Contents?: true

Size: 578 Bytes

Versions: 3

Compression:

Stored size: 578 Bytes

Contents

module FakeSQS
  module Actions
    class CreateQueue

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

      def call(params)
        name = params.fetch("QueueName")
        queue = @queues.create(name, params)
        @responder.call :CreateQueue do |xml|
          xml.QueueUrl @server.url_for(queue.name, {:host => @request.host, :port => @request.port})
        end
      end

    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
fake_sqs-0.4.3 lib/fake_sqs/actions/create_queue.rb
fake_sqs-0.4.2 lib/fake_sqs/actions/create_queue.rb
fake_sqs-0.4.1 lib/fake_sqs/actions/create_queue.rb