Class: RgGen::Core::Builder::Layer::Proxy

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

Instance Method Summary collapse

Constructor Details

#initialize(**proxy_config) ⇒ Proxy

Returns a new instance of Proxy.



8
9
10
# File 'lib/rggen/core/builder/layer.rb', line 8

def initialize(**proxy_config)
  @proxy_config = proxy_config
end

Instance Method Details

#execute(layer, method_name) ⇒ Object



25
26
27
28
29
30
31
32
33
# File 'lib/rggen/core/builder/layer.rb', line 25

def execute(layer, method_name, &)
  Docile.dsl_eval(layer, &)
  return unless @executions

  args = execution_args(layer)
  @executions.each do |(registry, bodies)|
    registry.__send__(method_name, *args, bodies)
  end
end

#feature_nameObject



12
13
14
# File 'lib/rggen/core/builder/layer.rb', line 12

def feature_name
  @proxy_config[:feature_name]
end

#list_nameObject



16
17
18
# File 'lib/rggen/core/builder/layer.rb', line 16

def list_name
  @proxy_config[:list_name]
end

#register_execution(registry, &body) ⇒ Object



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

def register_execution(registry, &body)
  @executions ||= Hash.new { |h, k| h[k] = [] }
  @executions[registry] << body
end