Method: Puppet::Pops::Types::PAnyType.new_function

Defined in:
lib/puppet/pops/types/types.rb

.new_function(type) ⇒ Function

This default implementation of of a new_function raises an Argument Error. Types for which creating a new instance is supported, should create and return a Puppet Function class by using Puppet:Loaders.create_loaded_function(:new, loader) and return that result.

Parameters:

  • type (PAnyType)

    the type to create a new function for

Returns:

  • (Function)

    the created function

Raises:

  • (ArgumentError)


341
342
343
# File 'lib/puppet/pops/types/types.rb', line 341

def self.new_function(type)
  raise ArgumentError.new("Creation of new instance of type '#{type}' is not supported")
end