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