Sha256: 7f46f20f18b4be1fc26e8c2174ea6c8308e2317ead49edd916108326027cdb4d
Contents?: true
Size: 392 Bytes
Versions: 5
Compression:
Stored size: 392 Bytes
Contents
require 'semlogr/error' module Semlogr class ComponentRegistry @mappings = {} def self.register(type, mapping) (@mappings[type] ||= {}).update(mapping) end def self.resolve(type, key, *params) mapping = @mappings[type] && @mappings[type][key] raise ComponentNotRegisteredError.new(type, key) unless mapping mapping.new(*params) end end end
Version data entries
5 entries across 5 versions & 1 rubygems