Sha256: b21b172abee276da110ce1fc52643cada44b9445acce0692bbbda1e19f700301

Contents?: true

Size: 874 Bytes

Versions: 5

Compression:

Stored size: 874 Bytes

Contents

module MessageDriver
  module Message
    class Base
      include Logging

      attr_reader :ctx, :destination, :body, :raw_body, :headers, :properties

      def initialize(ctx, destination, body, headers, properties, raw_body = nil)
        @ctx = ctx
        @destination = destination
        @body = body
        @headers = headers
        @properties = properties
        @raw_body = raw_body.nil? ? body : raw_body
      end

      def ack(options = {})
        if ctx.supports_client_acks?
          ctx.ack_message(self, options)
        else
          logger.debug('this adapter does not support client acks')
        end
      end

      def nack(options = {})
        if ctx.supports_client_acks?
          ctx.nack_message(self, options)
        else
          logger.debug('this adapter does not support client acks')
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
message-driver-1.0.1 lib/message_driver/message.rb
message-driver-1.0.0 lib/message_driver/message.rb
message-driver-0.7.2 lib/message_driver/message.rb
message-driver-0.7.1 lib/message_driver/message.rb
message-driver-0.7.0 lib/message_driver/message.rb