Method: Puppet::Pops::Types::PTypeType.new_function

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

.new_function(type) ⇒ Object

Returns a new function that produces a Type instance



479
480
481
482
483
484
485
486
487
488
489
# File 'lib/puppet/pops/types/types.rb', line 479

def self.new_function(type)
  @new_function ||= Puppet::Functions.create_loaded_function(:new_type, type.loader) do
    dispatch :from_string do
      param 'String[1]', :type_string
    end

    def from_string(type_string)
      TypeParser.singleton.parse(type_string, loader)
    end
  end
end