Sha256: 320e816a8f48d4319b79b961212058b27b7c5b2b44ca64ac5ea53e1addbcfbb5

Contents?: true

Size: 456 Bytes

Versions: 15

Compression:

Stored size: 456 Bytes

Contents

# frozen_string_literal: true

module RailwayIpc
  HandlerManifest = Struct.new(:message, :handler)
  class HandlerStore
    attr_reader :handler_map

    def initialize
      @handler_map = {}
    end

    def registered
      handler_map.keys
    end

    def register(message:, handler:)
      handler_map[message.to_s] = HandlerManifest.new(message, handler)
    end

    def get(response_message)
      handler_map[response_message]
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
railway-ipc-5.1.1 lib/railway_ipc/handler_store.rb
railway-ipc-5.1.0 lib/railway_ipc/handler_store.rb
railway-ipc-5.0.0 lib/railway_ipc/handler_store.rb
railway-ipc-4.0.1 lib/railway_ipc/handler_store.rb
railway-ipc-4.0.0 lib/railway_ipc/handler_store.rb
railway-ipc-3.0.0 lib/railway_ipc/handler_store.rb
railway-ipc-2.2.2 lib/railway_ipc/handler_store.rb
railway-ipc-2.2.1 lib/railway_ipc/handler_store.rb
railway-ipc-2.2.0 lib/railway_ipc/handler_store.rb
railway-ipc-2.1.0 lib/railway_ipc/handler_store.rb
railway-ipc-2.0.3 lib/railway_ipc/handler_store.rb
railway-ipc-2.0.2 lib/railway_ipc/handler_store.rb
railway-ipc-2.0.1 lib/railway_ipc/handler_store.rb
railway-ipc-2.0.0 lib/railway_ipc/handler_store.rb
railway-ipc-1.1.0 lib/railway_ipc/handler_store.rb