Sha256: da18efe1e9228149d6eec9b9b02a664d7f0abf2eec172b5232b10f866d49deb1

Contents?: true

Size: 699 Bytes

Versions: 10

Compression:

Stored size: 699 Bytes

Contents

module FakeSQS
  module Actions
    class ReceiveMessage

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

      def call(name, params)
        queue = @queues.get(name)
        messages = queue.receive_message(params)
        @responder.call :ReceiveMessage do |xml|
          messages.each do |receipt, message|
            xml.Message do
              xml.MessageId message.id
              xml.ReceiptHandle receipt
              xml.MD5OfBody message.md5
              xml.Body message.body
            end
          end
        end
      end

    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
fake_sqs-0.3.1 lib/fake_sqs/actions/receive_message.rb
fake_sqs-0.3.0 lib/fake_sqs/actions/receive_message.rb
fake_sqs-0.2.0 lib/fake_sqs/actions/receive_message.rb
fake_sqs-0.1.0 lib/fake_sqs/actions/receive_message.rb
fake_sqs-0.0.11 lib/fake_sqs/actions/receive_message.rb
fake_sqs-0.0.10 lib/fake_sqs/actions/receive_message.rb
fake_sqs-0.0.9 lib/fake_sqs/actions/receive_message.rb
fake_sqs-0.0.8 lib/fake_sqs/actions/receive_message.rb
fake_sqs-0.0.7 lib/fake_sqs/actions/receive_message.rb
fake_sqs-0.0.6 lib/fake_sqs/actions/receive_message.rb