Sha256: 045557b6bfadd8af273d64a705aa75d04ced6c24be2f73c294d7ad85a717789d

Contents?: true

Size: 694 Bytes

Versions: 1

Compression:

Stored size: 694 Bytes

Contents

module RosettaQueue
  module MessageHandler

    module ClassMethods

      attr_reader :destination, :options_hash

      def options(options = {})
        @options_hash = options
      end

      def publishes_to(destination)
        @destination = destination
      end

      def subscribes_to(destination)
        @destination = destination
      end
    end

    def self.included(receiver)
      receiver.extend(ClassMethods)
      attr_accessor :adapter_proxy

      def destination
        self.class.destination
      end

      def options_hash
        self.class.options_hash
      end

      def ack
        adapter_proxy.ack unless adapter_proxy.nil?
      end

    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
bmabey-rosetta_queue-0.3.3 lib/rosetta_queue/message_handler.rb