5 module Puppet::Parser::Functions
6 newfunction(:type3x, :type => :rvalue, :doc => <<-EOS
7 DEPRECATED: This function will be removed when puppet 3 support is dropped; please migrate to the new parser's typing system.
9 Returns the type when passed a value. Type can be one of:
19 raise(Puppet::ParseError, "type3x(): Wrong number of arguments given (#{args.size} for 1)") if args.size < 1
25 if not [TrueClass, FalseClass, Array, Bignum, Fixnum, Float, Hash, String].include?(klass)
26 raise(Puppet::ParseError, 'type3x(): Unknown type')
29 klass = klass.to_s # Ugly ...
31 # We note that Integer is the parent to Bignum and Fixnum ...
33 when /^(?:Big|Fix)num$/ then 'integer'
34 when /^(?:True|False)Class$/ then 'boolean'
38 if result == "String" then
39 if value == value.to_i.to_s then
41 elsif value == value.to_f.to_s then
46 return result.downcase
50 # vim: set ts=2 sw=2 et :