class Puppet::Pops::Evaluator::Closure::Named

Public Class Methods

new(name, evaluator, model) click to toggle source
Calls superclass method Puppet::Pops::Evaluator::Closure::new
    # File lib/puppet/pops/evaluator/closure.rb
195 def initialize(name, evaluator, model)
196   @name = name
197   super(evaluator, model)
198 end

Public Instance Methods

closure_name() click to toggle source
    # File lib/puppet/pops/evaluator/closure.rb
200 def closure_name
201   @name
202 end
enclosing_scope() click to toggle source

The assigned enclosing scope, or global scope if enclosing scope was initialized to nil

    # File lib/puppet/pops/evaluator/closure.rb
206 def enclosing_scope
207   # Named closures are typically used for puppet functions and they cannot be defined
208   # in an enclosing scope as they are cashed and reused. They need to bind to the
209   # global scope at time of use rather at time of definition.
210   # Unnamed closures are always a runtime construct, they are never bound by a loader
211   # and are thus garbage collected at end of a compilation.
212   #
213   Puppet.lookup(:global_scope) { {} }
214 end