Class: RgGen::Core::Builder::Layer::Proxy
- Defined in:
- lib/rggen/core/builder/layer.rb
Instance Method Summary collapse
- #execute(layer, method_name) ⇒ Object
- #feature_name ⇒ Object
-
#initialize(**proxy_config) ⇒ Proxy
constructor
A new instance of Proxy.
- #list_name ⇒ Object
- #register_execution(registry, &body) ⇒ Object
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_name ⇒ Object
12 13 14 |
# File 'lib/rggen/core/builder/layer.rb', line 12 def feature_name @proxy_config[:feature_name] end |
#list_name ⇒ Object
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 |