lib/puppet/functions.rb
# Defines a local type alias, the given string should be a Puppet Language type alias expression
# in string form without the leading 'type' keyword.
# Calls to local_type must be made before the first parameter definition or an error will
# be raised.
#
# @param assignment_string [String] a string on the form 'AliasType = ExistingType'
# @api public
#
Defines a local type alias, the given string should be a Puppet Language type alias expression
in string form without the leading 'type' keyword.
Calls to local_type must be made before the first parameter definition or an error will
be raised.
Defines a local type alias the given string should be a Puppet Language type alias expression in string form without the leading ' type ' keyword . Calls to local_type must be made before the first parameter definition or an error will be raised .
def type(assignment_string)
      result = parser.parse_string("type #{assignment_string}", nil) 
      unless result.body.kind_of?(Puppet::Pops::Model::TypeAlias)
        raise ArgumentError, _("Expected a type alias assignment on the form 'AliasType = T', got '%{assignment_string}'") % { assignment_string: assignment_string }
      end
      @local_types << result.body
    end
def type ( assignment_string ) result = parser . parse_string ( "type #{assignment_string}" , nil ) unless result . body . kind_of? ( Puppet :: Pops :: Model :: TypeAlias ) raise ArgumentError , _ ( "Expected a type alias assignment on the form 'AliasType = T', got '%{assignment_string}'" ) % { assignment_string : assignment_string } end @local_types << result . body end
Defines a local type alias, the given string should be a Puppet Language type alias expression
in string form without the leading 'type' keyword.
Defines a local type alias the given string should be a Puppet Language type alias expression in string form without the leading ' type ' keyword .
# no file source :-(
assignment_string
a string on the form 'AliasType = ExistingType'
a string on the form ' AliasType = ExistingType '
api
None