lib/message_driver/message.rb in message-driver-0.4.0 vs lib/message_driver/message.rb in message-driver-0.5.0

- old
+ new

@@ -1,27 +1,28 @@ module MessageDriver module Message class Base include Logging - attr_reader :ctx, :body, :headers, :properties + attr_reader :ctx, :body, :raw_body, :headers, :properties - def initialize(ctx, body, headers, properties) + def initialize(ctx, body, headers, properties, raw_body = nil) @ctx = ctx @body = body @headers = headers @properties = properties + @raw_body = raw_body.nil? ? body : raw_body end - def ack(options={}) + 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={}) + def nack(options = {}) if ctx.supports_client_acks? ctx.nack_message(self, options) else logger.debug('this adapter does not support client acks') end