summaryrefslogtreecommitdiff
path: root/README.markdown
diff options
context:
space:
mode:
authorAlex Cline <acline@us.ibm.com>2013-05-13 12:09:33 -0400
committerAlex Cline <acline@us.ibm.com>2013-05-13 12:14:15 -0400
commit737aa31546e71e9febea2199582510ef88a2560c (patch)
tree280dc920205cd8d1ba9127d01eb5f37d065e8311 /README.markdown
parent1ffd72daaaf21e71e762b6cd543043680bdb6694 (diff)
downloadpuppet-stdlib-737aa31546e71e9febea2199582510ef88a2560c.tar.gz
puppet-stdlib-737aa31546e71e9febea2199582510ef88a2560c.tar.bz2
(#20684) Add array comparison functions, difference, intersection and union.
Included is code, tests and documentation for the difference, intersection and union functions for comparing arrays.
Diffstat (limited to 'README.markdown')
-rw-r--r--README.markdown33
1 files changed, 33 insertions, 0 deletions
diff --git a/README.markdown b/README.markdown
index 7b45b17..8d07a82 100644
--- a/README.markdown
+++ b/README.markdown
@@ -195,6 +195,18 @@ Would return: ['a','c']
- *Type*: rvalue
+difference
+----------
+This function returns the difference between two arrays.
+The returned array is a copy of the original array, removing any items that
+also appear in the second array.
+
+*Examples:*
+
+ difference(["a","b","c"],["b","c","d"])
+
+Would return: ["a"]
+
dirname
-------
Returns the `dirname` of a path.
@@ -416,6 +428,16 @@ Would return: {'a'=>1,'b'=>2,'c'=>3}
- *Type*: rvalue
+intersection
+-----------
+This function returns an array an intersection of two.
+
+*Examples:*
+
+ intersection(["a","b","c"],["b","c","d"])
+
+Would return: ["b","c"]
+
is_array
--------
Returns true if the variable passed to this function is an array.
@@ -868,6 +890,17 @@ Returns the type when passed a variable. Type can be one of:
- *Type*: rvalue
+union
+-----
+This function returns a union of two arrays.
+
+*Examples:*
+
+ union(["a","b","c"],["b","c","d"])
+
+Would return: ["a","b","c","d"]
+
+
unique
------
This function will remove duplicates from strings and arrays.