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