class Puppet::Pops::Lookup::ScopeLookupCollectingInvocation

@api private

Public Class Methods

new(scope) click to toggle source
Calls superclass method
   # File lib/puppet/pops/lookup/hiera_config.rb
11 def initialize(scope)
12   super(scope)
13   @scope_interpolations = []
14 end

Public Instance Methods

remember_scope_lookup(key, root_key, segments, value) click to toggle source
   # File lib/puppet/pops/lookup/hiera_config.rb
16 def remember_scope_lookup(key, root_key, segments, value)
17   @scope_interpolations << [key, root_key, segments, value] unless !value.nil? && key.start_with?('::')
18 end
scope_interpolations() click to toggle source
   # File lib/puppet/pops/lookup/hiera_config.rb
20 def scope_interpolations
21   # Save extra checks by keeping the array unique with respect to the key (first entry)
22   @scope_interpolations.uniq! { |si| si[0] }
23   @scope_interpolations
24 end
with_local_memory_eluding(name) { || ... } click to toggle source

Yield invocation that remembers all but the given name

   # File lib/puppet/pops/lookup/hiera_config.rb
27 def with_local_memory_eluding(name)
28   save_si = @scope_interpolations
29   @scope_interpolations = []
30   result = yield
31   save_si.concat(@scope_interpolations.reject { |entry| entry[1] == name })
32   @scope_interpolations = save_si
33   result
34 end