Sha256: 43279f02c2da8a85121415a696a3d63f88659610639e5853206bbffeb2d5b7c1

Contents?: true

Size: 459 Bytes

Versions: 4

Compression:

Stored size: 459 Bytes

Contents

class Freddy
  class MessageHandler
    attr_reader :destination, :correlation_id

    def initialize(adapter, delivery)
      @adapter = adapter
      @metadata = delivery.metadata
      @correlation_id = @metadata.correlation_id
    end

    def success(response = nil)
      @adapter.success(@metadata.reply_to, response)
    end

    def error(error = {error: "Couldn't process message"})
      @adapter.error(@metadata.reply_to, error)
    end
  end
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
freddy-0.4.6 lib/freddy/message_handler.rb
freddy-0.4.4 lib/freddy/message_handler.rb
freddy-jruby-0.4.3 lib/freddy/message_handler.rb
freddy-0.4.3 lib/freddy/message_handler.rb