Other types
These types aren’t quite like the others.
The Callable
data type
The Callable
data type matches callable
lambdas provided as function arguments.
There is no way to interact with Callable
values in the Puppet language,
but Ruby functions written to the function API (Puppet::Functions
) can use Callable
to inspect the lambda provided to the function.
The full signature for Callable
is:
Callable[ (<DATA TYPE>, ...,) <MIN COUNT>, <MAX COUNT>, <BLOCK TYPE> ]
All of these parameters are optional.
Position | Parameter | Data type | Default value | Description |
---|---|---|---|---|
1 to n | Data type | Type | none | Any number of data types, representing the data type of each argument the lambda accepts. |
-3 (third last) | Minimum count | Integer | 0 | The minimum number of arguments the lambda accepts. This parameter
accepts the value default , which
uses its default value 0. |
-2 (second last) | Maximum count | Integer | infinity | The maximum number of arguments the lambda accepts. This parameter
accepts the value default , which
uses its default value, infinity. |
-1 (last) | Block type | Type[Callable] | none | The block_type of the
lambda. |