Class: RgGen::Core::Builder::ComponentEntry

Inherits:
Object
  • Object
show all
Defined in:
lib/rggen/core/builder/component_entry.rb

Defined Under Namespace

Classes: Entry

Instance Method Summary collapse

Constructor Details

#initialize(component_name, layer) ⇒ ComponentEntry

Returns a new instance of ComponentEntry.



9
10
11
12
# File 'lib/rggen/core/builder/component_entry.rb', line 9

def initialize(component_name, layer)
  @component_name = component_name
  @layer = layer
end

Instance Method Details

#build_factoryObject



25
26
27
28
29
30
# File 'lib/rggen/core/builder/component_entry.rb', line 25

def build_factory
  @component.factory.new(@component_name, @layer) do |f|
    f.target_component(@component.target)
    f.feature_factories(feature_registry&.build_factories)
  end
end

#feature_registryObject



20
21
22
23
# File 'lib/rggen/core/builder/component_entry.rb', line 20

def feature_registry
  return unless @feature
  @feature_registry ||= FeatureRegistry.new(*@feature.values)
end