summaryrefslogtreecommitdiff
path: root/lib/puppet/parser/functions/unique.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/puppet/parser/functions/unique.rb')
-rw-r--r--lib/puppet/parser/functions/unique.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/puppet/parser/functions/unique.rb b/lib/puppet/parser/functions/unique.rb
index a922c94..8844a74 100644
--- a/lib/puppet/parser/functions/unique.rb
+++ b/lib/puppet/parser/functions/unique.rb
@@ -4,6 +4,23 @@
module Puppet::Parser::Functions
newfunction(:unique, :type => :rvalue, :doc => <<-EOS
+This function will remove duplicates from strings and arrays.
+
+*Examples:*
+
+ unique("aabbcc")
+
+Will return:
+
+ abc
+
+You can also use this with arrays:
+
+ unique(["a","a","b","b","c","c"])
+
+This returns:
+
+ ["a","b","c"]
EOS
) do |arguments|