Sha256: 3c9b1371f66ced61123eb9e762ab5f869acabdd395f263dd8d333912edc6e413
Contents?: true
Size: 737 Bytes
Versions: 9
Compression:
Stored size: 737 Bytes
Contents
module Dry module System class Booter class ComponentRegistry include Enumerable attr_reader :components def initialize @components = [] end def each(&block) components.each(&block) end def register(component) @components << component end def exists?(name) components.any? { |component| component.identifier == name } end def [](name) component = components.detect { |component| component.identifier == name } if component component else raise InvalidComponentIdentifierError, name end end end end end end
Version data entries
9 entries across 9 versions & 1 rubygems