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
196 def initialize(name, evaluator, model)
197   @name = name
198   super(evaluator, model)
199 end

Public Instance Methods

closure_name() click to toggle source
    # File lib/puppet/pops/evaluator/closure.rb
201 def closure_name
202   @name
203 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
207 def enclosing_scope
208   # Named closures are typically used for puppet functions and they cannot be defined
209   # in an enclosing scope as they are cashed and reused. They need to bind to the
210   # global scope at time of use rather at time of definition.
211   # Unnamed closures are always a runtime construct, they are never bound by a loader
212   # and are thus garbage collected at end of a compilation.
213   #
214   Puppet.lookup(:global_scope) { {} }
215 end