Class: Puppet::Functions::InternalDispatchBuilder Private

Inherits:
DispatcherBuilder show all
Defined in:
lib/puppet/functions.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Injection and Weaving of parameters


It is possible to inject and weave a set of well known parameters into a call. These extra parameters are not part of the parameters passed from the Puppet logic, and they can not be overridden by parameters given as arguments in the call. They are invisible to the Puppet Language.

The function in the example above is called like this:

test(10, 20)

Examples:

using injected parameters

Puppet::Functions.create_function('test') do
  dispatch :test do
    param 'Scalar', 'a'
    param 'Scalar', 'b'
    scope_param
  end
  def test(a, b, scope)
    a > b ? scope['a'] : scope['b']
  end
end

Instance Attribute Summary

Attributes inherited from DispatcherBuilder

#loader

Instance Method Summary collapse

Methods inherited from DispatcherBuilder

#block_param, #initialize, #optional_block_param, #optional_param, #param, #repeated_param, #required_repeated_param, #return_type

Constructor Details

This class inherits a constructor from Puppet::Functions::DispatcherBuilder

Instance Method Details

#cache_paramObject

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.

Inject a parameter getting a cached hash for this function


840
841
842
# File 'lib/puppet/functions.rb', line 840

def cache_param
  inject(:cache)
end

#compiler_paramObject

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.

Inject parameter for `Puppet::Pal::CatalogCompiler`


845
846
847
# File 'lib/puppet/functions.rb', line 845

def compiler_param
  inject(:pal_catalog_compiler)
end

#pal_compiler_paramObject

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.

Inject parameter for either `Puppet::Pal::CatalogCompiler` or `Puppet::Pal::ScriptCompiler`


850
851
852
# File 'lib/puppet/functions.rb', line 850

def pal_compiler_param
  inject(:pal_compiler)
end

#scope_paramObject

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.

Inject parameter for `Puppet::Parser::Scope`


830
831
832
# File 'lib/puppet/functions.rb', line 830

def scope_param
  inject(:scope)
end

#script_compiler_paramObject

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.

Inject parameter for `Puppet::Pal::ScriptCompiler`


835
836
837
# File 'lib/puppet/functions.rb', line 835

def script_compiler_param
  inject(:pal_script_compiler)
end