Sha256: 1103375611616498235f51b3dd2cdbfa0f6dd48c31bbe0a083c3c076896724c8

Contents?: true

Size: 452 Bytes

Versions: 3

Compression:

Stored size: 452 Bytes

Contents

# frozen_string_literal: true

module PgEventstore
  module Extensions
    module CallbackHandlersExtension
      def self.included(klass)
        klass.extend(ClassMethods)
      end

      module ClassMethods
        # @param name [Symbol] a name of the handler
        # @return [Proc]
        def setup_handler(name, *args)
          proc do |*rest|
            public_send(name, *args, *rest)
          end
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
pg_eventstore-1.7.0 lib/pg_eventstore/extensions/callback_handlers_extension.rb
pg_eventstore-1.6.0 lib/pg_eventstore/extensions/callback_handlers_extension.rb
pg_eventstore-1.5.0 lib/pg_eventstore/extensions/callback_handlers_extension.rb