class Dry::System::IndirectComponent

An indirect component is a component that cannot be directly from a source file directly managed by the container. It may be component that needs to be loaded indirectly, either via a manual registration file or an imported container

Indirect components are an internal abstraction and, unlike ordinary components, are not exposed to users via component dir configuration hooks.

@see Container#load_component @see Container#find_component

@api private

Attributes

identifier[R]

@!attribute [r] identifier

@return [String] the component's unique identifier

Public Class Methods

new(identifier) click to toggle source

@api private

# File lib/dry/system/indirect_component.rb, line 26
def initialize(identifier)
  @identifier = identifier
end

Public Instance Methods

key() click to toggle source

Returns the component's unique key

@return [String] the key

@see Identifier#key

@api private

# File lib/dry/system/indirect_component.rb, line 49
def key
  identifier.to_s
end
loadable?() click to toggle source

Returns false, indicating that the component is not directly loadable from the files managed by the container

This is the inverse of {Component#loadable?}

@return [FalseClass]

@api private

# File lib/dry/system/indirect_component.rb, line 38
def loadable?
  false
end
root_key() click to toggle source

Returns the root namespace segment of the component's key, as a symbol

@see Identifier#root_key

@return [Symbol] the root key

@api private

# File lib/dry/system/indirect_component.rb, line 60
def root_key
  identifier.root_key
end