Method: Puppet::Context#initialize

Defined in:
lib/puppet/context.rb

#initialize(initial_bindings) ⇒ Context

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 Context.



25
26
27
28
29
30
31
32
# File 'lib/puppet/context.rb', line 25

def initialize(initial_bindings)
  @stack = Puppet::ThreadLocal.new(EmptyStack.new.push(initial_bindings))

  # By initializing @rollbacks to nil and creating a hash lazily when #mark or
  # #rollback are called we ensure that the hashes are never shared between
  # threads and it's safe to mutate them
  @rollbacks = Puppet::ThreadLocal.new(nil)
end