Class: KuberKit::Core::ContextHelper::LocalContextHelper

Inherits:
AbstractHelper show all
Defined in:
lib/kuber_kit/core/context_helper/local_context_helper.rb

Instance Method Summary collapse

Methods inherited from AbstractHelper

#get_binding

Constructor Details

#initialize(parent_context_helper:, variables:) ⇒ LocalContextHelper

Returns a new instance of LocalContextHelper.



2
3
4
5
# File 'lib/kuber_kit/core/context_helper/local_context_helper.rb', line 2

def initialize(parent_context_helper:, variables:)
  @parent_context_helper = parent_context_helper
  @variables = variables
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method_name, *args, **kwargs, &block) ⇒ Object



7
8
9
10
11
12
13
# File 'lib/kuber_kit/core/context_helper/local_context_helper.rb', line 7

def method_missing(method_name, *args, **kwargs, &block)
  if @variables.has_key?(method_name)
    @variables[method_name]
  else
    @parent_context_helper.send(method_name, *args, **kwargs, &block)
  end
end