class Dry::System::Booter::ComponentRegistry
Attributes
components[R]
Public Class Methods
new()
click to toggle source
# File lib/dry/system/booter/component_registry.rb, line 11 def initialize @components = [] end
Public Instance Methods
[](name)
click to toggle source
# File lib/dry/system/booter/component_registry.rb, line 27 def [](name) component = components.detect { |component| component.identifier == name } component || raise(InvalidComponentIdentifierError, name) end
each(&block)
click to toggle source
# File lib/dry/system/booter/component_registry.rb, line 15 def each(&block) components.each(&block) end
exists?(name)
click to toggle source
# File lib/dry/system/booter/component_registry.rb, line 23 def exists?(name) components.any? { |component| component.identifier == name } end
register(component)
click to toggle source
# File lib/dry/system/booter/component_registry.rb, line 19 def register(component) @components << component end