Class: RgGen::Core::Builder::InputComponentRegistry
Instance Method Summary
collapse
#register_component, #register_global_component
Constructor Details
Returns a new instance of InputComponentRegistry.
7
8
9
10
11
12
|
# File 'lib/rggen/core/builder/input_component_registry.rb', line 7
def initialize(name, builder)
super
@loader_registries = Hash.new do |h, k|
h[k] = LoaderRegistry.new
end
end
|
Instance Method Details
#build_factory ⇒ Object
31
32
33
34
35
|
# File 'lib/rggen/core/builder/input_component_registry.rb', line 31
def build_factory
factory = super
factory.loaders(build_loaders)
factory
end
|
26
27
28
29
|
# File 'lib/rggen/core/builder/input_component_registry.rb', line 26
def (loader_type, layers = nil, value, &body)
@loader_registries[loader_type]
.(layers, value, &body)
end
|
#register_loader(loader_type, loader) ⇒ Object
14
15
16
|
# File 'lib/rggen/core/builder/input_component_registry.rb', line 14
def register_loader(loader_type, loader)
@loader_registries[loader_type].register_loader(loader)
end
|
#register_loaders(loader_type, loaders) ⇒ Object
18
19
20
|
# File 'lib/rggen/core/builder/input_component_registry.rb', line 18
def register_loaders(loader_type, loaders)
@loader_registries[loader_type].register_loaders(loaders)
end
|
#setup_loader(loader_type) ⇒ Object
22
23
24
|
# File 'lib/rggen/core/builder/input_component_registry.rb', line 22
def setup_loader(loader_type)
block_given? && yield(@loader_registries[loader_type])
end
|