aboutsummaryrefslogtreecommitdiff
path: root/lib/puppet/parser/functions/array_union.rb
blob: 1ccad3f18e2fe14ce025ec2cb57f0f5531c6fb1a (plain)
1
2
3
4
5
6
7
8
9
10
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