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



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

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`



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

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`



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

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`



826
827
828
# File 'lib/puppet/functions.rb', line 826

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`



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

def script_compiler_param
  inject(:pal_script_compiler)
end