Method: Puppet::Pops::Functions::Dispatch#initialize

Defined in:
lib/puppet/pops/functions/dispatch.rb

#initialize(type, method_name, param_names, last_captures = false, block_name = nil, injections = EMPTY_ARRAY, weaving = EMPTY_ARRAY, argument_mismatch_handler = false) ⇒ Dispatch

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 new instance of Dispatch.

Parameters:

    • type describing signature

  • the name of the method that will be called when type matches given arguments

  • names matching the number of parameters specified by type (or empty array)

  • (defaults to: nil)

    name of block parameter, no nil

  • (defaults to: EMPTY_ARRAY)

    injection data for weaved parameters

  • (defaults to: EMPTY_ARRAY)

    weaving knits

  • (defaults to: false)

    true if last parameter is captures rest

  • (defaults to: false)

    true if this is a dispatch for an argument mismatch

API:

  • private



35
36
37
38
39
40
41
42
43
44
# File 'lib/puppet/pops/functions/dispatch.rb', line 35

def initialize(type, method_name, param_names, last_captures = false, block_name = nil, injections = EMPTY_ARRAY, weaving = EMPTY_ARRAY, argument_mismatch_handler = false)
  @type = type
  @method_name = method_name
  @param_names = param_names
  @last_captures = last_captures
  @block_name = block_name
  @injections = injections
  @weaving = weaving
  @argument_mismatch_handler = argument_mismatch_handler
end