Method: Puppet::Pops::Functions::Dispatch#invoke

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

#invoke(instance, calling_scope, args, &block) ⇒ Object

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.



61
62
63
64
65
66
# File 'lib/puppet/pops/functions/dispatch.rb', line 61

def invoke(instance, calling_scope, args, &block)
  result = instance.send(@method_name, *weave(calling_scope, args), &block)
  return_type = @type.return_type
  Types::TypeAsserter.assert_instance_of(nil, return_type, result) { "value returned from function '#{@method_name}'" } unless return_type.nil?
  result
end