Sha256: 16d8abf2675abdb3297be2135064b9ec04295f12ea0d9a2c4a09e0686a4efd02
Contents?: true
Size: 706 Bytes
Versions: 14
Compression:
Stored size: 706 Bytes
Contents
# frozen_string_literal: true 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 } component || raise(InvalidComponentIdentifierError, name) end end end end end
Version data entries
14 entries across 14 versions & 1 rubygems