Class: Puppet::Pops::Evaluator::DeferredValue

Inherits:
Object
  • Object
show all
Defined in:
lib/puppet/pops/evaluator/deferred_resolver.rb

Instance Method Summary collapse

Constructor Details

#initialize(proc) ⇒ DeferredValue

Returns a new instance of DeferredValue.



8
9
10
# File 'lib/puppet/pops/evaluator/deferred_resolver.rb', line 8

def initialize(proc)
  @proc = proc
end

Instance Method Details

#resolveObject



12
13
14
15
16
17
18
19
20
# File 'lib/puppet/pops/evaluator/deferred_resolver.rb', line 12

def resolve
  val = @proc.call
  # Deferred sensitive values will be marked as such in resolve_futures()
  if val.is_a?(Puppet::Pops::Types::PSensitiveType::Sensitive)
    val.unwrap
  else
    val
  end
end