Class: RgGen::Core::Builder::ComponentRegistry
- Inherits:
-
Object
- Object
- RgGen::Core::Builder::ComponentRegistry
show all
- Defined in:
- lib/rggen/core/builder/component_registry.rb
Instance Method Summary
collapse
Constructor Details
#initialize(component_name, builder) ⇒ ComponentRegistry
Returns a new instance of ComponentRegistry.
7
8
9
10
11
|
# File 'lib/rggen/core/builder/component_registry.rb', line 7
def initialize(component_name, builder)
@component_name = component_name
@builder = builder
@entries = []
end
|
Instance Method Details
#build_factory ⇒ Object
23
24
25
|
# File 'lib/rggen/core/builder/component_registry.rb', line 23
def build_factory
build_factories.first.tap(&:root_factory)
end
|
#disable_all_features ⇒ Object
27
28
29
|
# File 'lib/rggen/core/builder/component_registry.rb', line 27
def disable_all_features
@entries.each { |entry| entry.feature_registry&.disable_all }
end
|
#register_component(layers = nil) ⇒ Object
13
14
15
16
17
|
# File 'lib/rggen/core/builder/component_registry.rb', line 13
def register_component(layers = nil, &)
Array(layers || @builder.register_map_layers).each do |layer|
@entries << create_new_entry(layer, &)
end
end
|
#register_global_component ⇒ Object
19
20
21
|
# File 'lib/rggen/core/builder/component_registry.rb', line 19
def register_global_component(&)
@entries << create_new_entry(nil, &)
end
|