Sha256: dca506b02c2161d209deaaa01eda1daf12adb673194aad819d3aa8c51e4cd9c8
Contents?: true
Size: 1.02 KB
Versions: 68
Compression:
Stored size: 1.02 KB
Contents
# Calls an arbitrary Puppet function by name. # # This function takes one mandatory argument and one or more optional arguments: # # 1. A string corresponding to a function name. # 2. Any number of arguments to be passed to the called function. # 3. An optional lambda, if the function being called supports it. # # @example Using the `call` function # # ~~~ puppet # $a = 'notice' # call($a, 'message') # ~~~ # # @example Using the `call` function with a lambda # # ~~~ puppet # $a = 'each' # $b = [1,2,3] # call($a, $b) |$item| { # notify { $item: } # } # ~~~ # # The `call` function can be used to call either Ruby functions or Puppet language # functions. # # @since 5.0.0 # Puppet::Functions.create_function(:call, Puppet::Functions::InternalFunction) do dispatch :call_impl_block do scope_param param 'String', :function_name repeated_param 'Any', :arguments optional_block_param end def call_impl_block(scope, function_name, *args, &block) call_function_with_scope(scope, function_name, *args, &block) end end
Version data entries
68 entries across 68 versions & 2 rubygems