Sha256: 6c4605b6c3af506b63676ffe9d7beb98862992f18800f397693ff16ba1d40b84

Contents?: true

Size: 487 Bytes

Versions: 2

Compression:

Stored size: 487 Bytes

Contents

module Hoth
  class ServiceRegistry
    include Singleton
    
    def self.add_service(service)
      instance.add_service(service)
    end
    
    def self.locate_service(service_name)
      instance.locate_service(service_name)
    end
    
    def add_service(service)
      @registry[service.name] = service
    end
    
    def locate_service(service_name)
      @registry[service_name]
    end
    
    private
    
      def initialize
        @registry = {}
      end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
hoth-0.1.2 lib/hoth/service_registry.rb
hoth-0.1.1 lib/hoth/service_registry.rb