class Puppet::Pops::Lookup::FunctionContext

A FunctionContext is created for each unique hierarchy entry and adapted to the Compiler (and hence shares the compiler's life-cycle). @api private

Attributes

data_hash[RW]
function[R]
module_name[R]

Public Class Methods

new(environment_context, module_name, function) click to toggle source
   # File lib/puppet/pops/lookup/context.rb
69 def initialize(environment_context, module_name, function)
70   @data_hash = nil
71   @cache = {}
72   @environment_context = environment_context
73   @module_name = module_name
74   @function = function
75 end

Public Instance Methods

cache(key, value) click to toggle source
   # File lib/puppet/pops/lookup/context.rb
77 def cache(key, value)
78   @cache[key] = value
79 end
cache_all(hash) click to toggle source
   # File lib/puppet/pops/lookup/context.rb
81 def cache_all(hash)
82   @cache.merge!(hash)
83   nil
84 end
cache_has_key(key) click to toggle source
   # File lib/puppet/pops/lookup/context.rb
86 def cache_has_key(key)
87   @cache.include?(key)
88 end
cached_entries() { |*pair| ... } click to toggle source
    # File lib/puppet/pops/lookup/context.rb
 94 def cached_entries(&block)
 95   if block_given?
 96     @cache.each_pair do |pair|
 97       if block.arity == 2
 98         yield(*pair)
 99       else
100         yield(pair)
101       end
102     end
103     nil
104   else
105     Types::Iterable.on(@cache)
106   end
107 end
cached_file_data(path, &block) click to toggle source
    # File lib/puppet/pops/lookup/context.rb
109 def cached_file_data(path, &block)
110   @environment_context.cached_file_data(path, &block)
111 end
cached_value(key) click to toggle source
   # File lib/puppet/pops/lookup/context.rb
90 def cached_value(key)
91   @cache[key]
92 end
environment_name() click to toggle source
    # File lib/puppet/pops/lookup/context.rb
113 def environment_name
114   @environment_context.environment_name
115 end