Sha256: e15a97d7df0390cf61526389ac6c79f3cb89c80661959505d7b77ce2c69fedbd

Contents?: true

Size: 519 Bytes

Versions: 3

Compression:

Stored size: 519 Bytes

Contents

module Euston
  module CommandHandler
    extend ActiveSupport::Concern

    module ClassMethods
      def version number, &consumer
        define_method "__version__#{number}" do |*args|
          if block_given?
            instance_exec *args, &consumer
          else
            publish args.shift, args.shift
          end
        end
      end
    end

    module InstanceMethods
      protected

      def publish headers, command
        Euston::CommandBus.publish headers, command
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
euston-1.0.1 lib/euston/command_handler.rb
euston-1.0.1-java lib/euston/command_handler.rb
euston-1.0.0 lib/euston/command_handler.rb