Class: Puppet::Pops::Lookup::ScopeLookupCollectingInvocation Private
- Inherits:
-
Invocation
- Object
- Invocation
- Puppet::Pops::Lookup::ScopeLookupCollectingInvocation
- Defined in:
- lib/puppet/pops/lookup/hiera_config.rb
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Instance Attribute Summary
Attributes inherited from Invocation
#adapter_class, #default_values, #explainer, #module_name, #override_values, #scope, #top_key
Instance Method Summary collapse
-
#initialize(scope) ⇒ ScopeLookupCollectingInvocation
constructor
private
A new instance of ScopeLookupCollectingInvocation.
- #remember_scope_lookup(key, root_key, segments, value) ⇒ Object private
- #scope_interpolations ⇒ Object private
-
#with_local_memory_eluding(name) ⇒ Object
private
Yield invocation that remembers all but the given name.
Methods inherited from Invocation
#check, current, current=, #emit_debug_info, #explain_options?, #global_hiera_config_path, #global_only?, #hiera_v3_location_overrides, #hiera_v3_merge_behavior?, #hiera_xxx_call?, #lookup, #lookup_adapter, #only_explain_options?, #report_found, #report_found_in_defaults, #report_found_in_overrides, #report_location_not_found, #report_merge_source, #report_module_not_found, #report_module_provider_not_found, #report_not_found, #report_result, #report_text, #set_global_only, #set_hiera_v3_location_overrides, #set_hiera_v3_merge_behavior, #set_hiera_xxx_call, #with, #with_scope, #without_explain
Constructor Details
#initialize(scope) ⇒ ScopeLookupCollectingInvocation
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of ScopeLookupCollectingInvocation.
12 13 14 15 |
# File 'lib/puppet/pops/lookup/hiera_config.rb', line 12 def initialize(scope) super(scope) @scope_interpolations = [] end |
Instance Method Details
#remember_scope_lookup(key, root_key, segments, value) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
17 18 19 |
# File 'lib/puppet/pops/lookup/hiera_config.rb', line 17 def remember_scope_lookup(key, root_key, segments, value) @scope_interpolations << [key, root_key, segments, value] unless !value.nil? && key.start_with?('::') end |
#scope_interpolations ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
21 22 23 24 25 |
# File 'lib/puppet/pops/lookup/hiera_config.rb', line 21 def scope_interpolations # Save extra checks by keeping the array unique with respect to the key (first entry) @scope_interpolations.uniq! { |si| si[0] } @scope_interpolations end |
#with_local_memory_eluding(name) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Yield invocation that remembers all but the given name
28 29 30 31 32 33 34 35 |
# File 'lib/puppet/pops/lookup/hiera_config.rb', line 28 def with_local_memory_eluding(name) save_si = @scope_interpolations @scope_interpolations = [] result = yield save_si.concat(@scope_interpolations.reject { |entry| entry[1] == name }) @scope_interpolations = save_si result end |