Sha256: 3acc119bf27603608d0c99b35d78eb8c883dc9b37437ce5bdfe07b288976952b

Contents?: true

Size: 499 Bytes

Versions: 1

Compression:

Stored size: 499 Bytes

Contents

module FakeServiceBus
  module Actions
    class SendMessage

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

      def call(queue_name, params)
        queue = @queues.get(queue_name)
        message = queue.send_message(params.merge(
            {'queue_name'=>queue_name,
             'body'=>@request.body.read})
        )
        201
      end

    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
fake_servicebus-0.0.2 lib/fake_servicebus/actions/send_message.rb