Class: Dry::System::IndirectComponent Private
- Inherits:
-
Object
- Object
- Dry::System::IndirectComponent
- Defined in:
- lib/dry/system/indirect_component.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
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 registration manifest 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.
Instance Attribute Summary collapse
- #identifier ⇒ Object readonly private
Instance Method Summary collapse
-
#initialize(identifier) ⇒ IndirectComponent
constructor
private
A new instance of IndirectComponent.
-
#key ⇒ String
private
Returns the component’s unique key.
-
#loadable? ⇒ FalseClass
private
Returns false, indicating that the component is not directly loadable from the files managed by the container.
-
#root_key ⇒ Symbol
private
Returns the root namespace segment of the component’s key, as a symbol.
Constructor Details
#initialize(identifier) ⇒ IndirectComponent
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of IndirectComponent.
24 25 26 |
# File 'lib/dry/system/indirect_component.rb', line 24 def initialize(identifier) @identifier = identifier end |
Instance Attribute Details
#identifier ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
21 22 23 |
# File 'lib/dry/system/indirect_component.rb', line 21 def identifier @identifier end |
Instance Method Details
#key ⇒ String
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns the component’s unique key
47 48 49 |
# File 'lib/dry/system/indirect_component.rb', line 47 def key identifier.to_s end |
#loadable? ⇒ FalseClass
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns false, indicating that the component is not directly loadable from the files managed by the container
This is the inverse of Component#loadable?
36 37 38 |
# File 'lib/dry/system/indirect_component.rb', line 36 def loadable? false end |
#root_key ⇒ Symbol
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns the root namespace segment of the component’s key, as a symbol
58 59 60 |
# File 'lib/dry/system/indirect_component.rb', line 58 def root_key identifier.root_key end |