5 module Puppet::Parser::Functions
6 newfunction(:union, :type => :rvalue, :doc => <<-EOS
7 This function returns a union of two or more arrays.
11 union(["a","b","c"],["b","c","d"])
13 Would return: ["a","b","c","d"]
17 # Check that 2 or more arguments have been given ...
18 raise(Puppet::ParseError, "union(): Wrong number of arguments given (#{arguments.size} for < 2)") if arguments.size < 2
20 arguments.each do |argument|
21 raise(Puppet::ParseError, 'union(): Every parameter must be an array') unless argument.is_a?(Array)
28 # vim: set ts=2 sw=2 et :