module-common/lib/puppet/parser/functions/array_union.rb
2011-05-17 21:13:10 +02:00

10 lines
296 B
Ruby

Puppet::Parser::Functions::newfunction(
:array_union,
:type => :rvalue,
:doc => "Unions two arrays
Example: array_union(['a','b'],['c']) -> ['a','b','c']"
) do |args|
raise Puppet::ParseError, 'array_union() needs two arguments' if args.length != 2
args[0].to_a | args[1].to_a
end