Class: KuberKit::Core::ContextHelper::LocalContextHelper
- Inherits:
-
AbstractHelper
- Object
- AbstractHelper
- KuberKit::Core::ContextHelper::LocalContextHelper
- Defined in:
- lib/kuber_kit/core/context_helper/local_context_helper.rb
Instance Method Summary collapse
-
#initialize(parent_context_helper:, variables:) ⇒ LocalContextHelper
constructor
A new instance of LocalContextHelper.
- #method_missing(method_name, *args, **kwargs, &block) ⇒ Object
Methods inherited from AbstractHelper
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 |