module-common/lib/puppet/parser/functions/array_union.rb

11 lines
296 B
Ruby
Raw Normal View History

2011-05-17 21:10:40 +02:00
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