Class: Puppet::Pops::Lookup::GlobalDataProvider Private

Inherits:
ConfiguredDataProvider show all
Defined in:
lib/puppet/pops/lookup/global_data_provider.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 Method Summary collapse

Methods inherited from ConfiguredDataProvider

#config, #config_path, #initialize, #name

Methods included from DataProvider

ensure_types_initialized, #key_lookup, key_type, #lookup, #module_name, #name, #validate_data_entry, #validate_data_hash, #validate_data_value, value_type

Constructor Details

This class inherits a constructor from Puppet::Pops::Lookup::ConfiguredDataProvider

Instance Method Details

#place ⇒ 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.



8
9
10
# File 'lib/puppet/pops/lookup/global_data_provider.rb', line 8

def place
  'Global'
end

#unchecked_key_lookup(key, lookup_invocation, merge) ⇒ 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.



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/puppet/pops/lookup/global_data_provider.rb', line 12

def unchecked_key_lookup(key, lookup_invocation, merge)
  config = config(lookup_invocation)
  if(config.version == 3)
    # Hiera version 3 needs access to special scope variables
    scope = lookup_invocation.scope
    unless scope.is_a?(Hiera::Scope)
      lookup_invocation = Invocation.new(
        Hiera::Scope.new(scope),
        lookup_invocation.override_values,
        lookup_invocation.default_values,
        lookup_invocation.explainer)
    end
    merge = config.merge_strategy if merge.is_a?(DefaultMergeStrategy)
  end
  super(key, lookup_invocation, merge)
end