Method: Puppet::Pal::Compiler#function_signature

Defined in:
lib/puppet/pal/compiler.rb

#function_signature(function_name) ⇒ Puppet::Pal::FunctionSignature

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.

Returns a Puppet::Pal::FunctionSignature object or nil if function is not found The returned FunctionSignature has information about all overloaded signatures of the function

Examples:

using function_signature

# returns true if 'myfunc' is callable with three integer arguments 1, 2, 3
compiler.function_signature('myfunc').callable_with?([1,2,3])

Parameters:

  • function_name (String)

    the name of the function to get a signature for

Returns:



42
43
44
45
46
47
48
49
50
# File 'lib/puppet/pal/compiler.rb', line 42

def function_signature(function_name)
  loader = internal_compiler.loaders.private_environment_loader
  func = loader.load(:function, function_name)
  if func
    return FunctionSignature.new(func.class)
  end
  # Could not find function
  nil
end