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 " +
20 "given (#{args.size} for 1)") if args.size < 1
26 if not [TrueClass, FalseClass, Array, Bignum, Fixnum, Float, Hash, String].include?(klass)
27 raise(Puppet::ParseError, 'type3x(): Unknown type')
30 klass = klass.to_s # Ugly ...
32 # We note that Integer is the parent to Bignum and Fixnum ...
34 when /^(?:Big|Fix)num$/ then 'integer'
35 when /^(?:True|False)Class$/ then 'boolean'
39 if result == "String" then
40 if value == value.to_i.to_s then
42 elsif value == value.to_f.to_s then
47 return result.downcase
51 # vim: set ts=2 sw=2 et :