diff options
author | varac <varacanero@zeromail.org> | 2013-08-27 18:03:56 +0200 |
---|---|---|
committer | varac <varacanero@zeromail.org> | 2013-08-27 18:03:56 +0200 |
commit | 473896f2ca22f5003ea47542ad8026819d2d8613 (patch) | |
tree | 297936a37a0cf217a76a5cee368f7f91430d9f02 /README.markdown | |
parent | 966f3b349a60b3997e58af1095bbd96671952fac (diff) | |
parent | 2a78cbfaad2acc61d6d8bab715db00c9890adbd7 (diff) |
Merge branch 'master' of git://github.com/puppetlabs/puppetlabs-stdlib into leap_master
Diffstat (limited to 'README.markdown')
-rw-r--r-- | README.markdown | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/README.markdown b/README.markdown index 0e40f51..1e51e1d 100644 --- a/README.markdown +++ b/README.markdown @@ -204,6 +204,33 @@ Would return: ['a','c'] - *Type*: rvalue +delete_values +------------- +Deletes all instances of a given value from a hash. + +*Examples:* + + delete_values({'a'=>'A','b'=>'B','c'=>'C','B'=>'D'}, 'B') + +Would return: {'a'=>'A','c'=>'C','B'=>'D'} + + +delete_undef_values +------------------- +Deletes all instances of the undef value from an array or hash. + +*Examples:* + + $hash = delete_undef_values({a=>'A', b=>'', c=>undef, d => false}) + +Would return: {a => 'A', b => '', d => false} + + $array = delete_undef_values(['A','',undef,false]) + +Would return: ['A','',false] + +- *Type*: rvalue + difference ---------- This function returns the difference between two arrays. @@ -258,7 +285,7 @@ resource. This example only creates the resource if it does not already exist: - ensure_resource('user, 'dan', {'ensure' => 'present' }) + ensure_resource('user', 'dan', {'ensure' => 'present' }) If the resource already exists but does not match the specified parameters, this function will attempt to recreate the resource leading to a duplicate |