blob: a4cae403b9b333a4a89fc01e440a5f4d1a0eac9d (
plain)
1
2
3
4
5
6
7
8
9
10
|
Puppet::Parser::Functions::newfunction(
:uniq_flatten,
:type => :rvalue,
:doc => "Flattens an array and make it uniq
Example: uniq_flatten([['a','b'],'a']) -> ['a','b']"
) do |args|
raise Puppet::ParseError, 'uniq_flatten() needs one arguments' if args.length != 1
args[0].to_a.flatten.uniq
end
|