Sha256: f22d55fa7b90ed9e2cb7aa75c0840ea49e9ebc553771d5fdc0fd78554e6a28b7

Contents?: true

Size: 586 Bytes

Versions: 23

Compression:

Stored size: 586 Bytes

Contents

module Euston
  module CommandHandler
    extend ActiveSupport::Concern
    include Euston::CommandHandlerPrivateMethodNames

    module ClassMethods
      def version number, &consumer
        define_method command_handler_method_name(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

23 entries across 23 versions & 1 rubygems

Version Path
euston-1.2.10 lib/euston/command_handler.rb
euston-1.2.10-java lib/euston/command_handler.rb
euston-1.2.9-java lib/euston/command_handler.rb
euston-1.2.9 lib/euston/command_handler.rb
euston-1.2.8 lib/euston/command_handler.rb
euston-1.2.8-java lib/euston/command_handler.rb
euston-1.2.7-java lib/euston/command_handler.rb
euston-1.2.7 lib/euston/command_handler.rb
euston-1.2.6 lib/euston/command_handler.rb
euston-1.2.5-java lib/euston/command_handler.rb
euston-1.2.5 lib/euston/command_handler.rb
euston-1.2.4-java lib/euston/command_handler.rb
euston-1.2.4 lib/euston/command_handler.rb
euston-1.2.3 lib/euston/command_handler.rb
euston-1.2.3-java lib/euston/command_handler.rb
euston-1.2.2 lib/euston/command_handler.rb
euston-1.2.2-java lib/euston/command_handler.rb
euston-1.2.1 lib/euston/command_handler.rb
euston-1.2.1-java lib/euston/command_handler.rb
euston-1.2.0 lib/euston/command_handler.rb