Module: Puppet::Pops::Lookup::Interpolation
- Includes:
- SubLookup
- Included in:
- DataHashFunctionProvider, FunctionContext, LocationResolver
- Defined in:
- lib/puppet/pops/lookup/interpolation.rb
Constant Summary
Constants included from SubLookup
Instance Method Summary collapse
-
#interpolate(value, context, allow_methods) ⇒ Object
The result of resolving all interpolations in the given value.
Methods included from SubLookup
Instance Method Details
#interpolate(value, context, allow_methods) ⇒ Object
Returns the result of resolving all interpolations in the given value.
19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/puppet/pops/lookup/interpolation.rb', line 19 def interpolate(value, context, allow_methods) case value when String value.index('%{').nil? ? value : interpolate_string(value, context, allow_methods) when Array value.map { |element| interpolate(element, context, allow_methods) } when Hash result = {} value.each_pair { |k, v| result[interpolate(k, context, allow_methods)] = interpolate(v, context, allow_methods) } result else value end end |