Details
Description
An InternalFunction declared with the following dispatch:
Puppet::Functions.create_function('test', Puppet::Functions::InternalFunction) do
|
dispatch :test do
|
scope_param
|
param 'Integer', 'x'
|
required_block_param
|
end
|
def test(scope, x, block)
|
nil
|
end
|
end
|
will always fail with 'wrong number of arguments (2 for 3)' when called. The probable cause is that the block parameter is never added to the weaving array. The resulting array after weaving thus contains the scope and the parameter, not the block.