5 module Puppet::Parser::Functions
6 newfunction(:empty, :type => :rvalue, :doc => <<-EOS
7 Returns true if the variable is empty.
11 raise(Puppet::ParseError, "empty(): Wrong number of arguments given (#{arguments.size} for 1)") if arguments.size < 1
15 unless value.is_a?(Array) || value.is_a?(Hash) || value.is_a?(String) || value.is_a?(Numeric)
16 raise(Puppet::ParseError, 'empty(): Requires either array, hash, string or integer to work with')
19 if value.is_a?(Numeric)
29 # vim: set ts=2 sw=2 et :