projects
/
mirror
/
dsa-puppet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Update stdlib and concat to 6.1.0 both
[mirror/dsa-puppet.git]
/
3rdparty
/
modules
/
stdlib
/
lib
/
puppet
/
parser
/
functions
/
delete_values.rb
diff --git
a/3rdparty/modules/stdlib/lib/puppet/parser/functions/delete_values.rb
b/3rdparty/modules/stdlib/lib/puppet/parser/functions/delete_values.rb
index
f98f247
..
f162522
100644
(file)
--- a/
3rdparty/modules/stdlib/lib/puppet/parser/functions/delete_values.rb
+++ b/
3rdparty/modules/stdlib/lib/puppet/parser/functions/delete_values.rb
@@
-3,20
+3,22
@@
#
module Puppet::Parser::Functions
newfunction(:delete_values, :type => :rvalue, :doc => <<-DOC
#
module Puppet::Parser::Functions
newfunction(:delete_values, :type => :rvalue, :doc => <<-DOC
- Deletes all instances of a given value from a hash.
+ @summary
+ Deletes all instances of a given value from a hash.
- *Examples:*
+ @example Example usage
- delete_values({'a'=>'A','b'=>'B','c'=>'C','B'=>'D'}, 'B')
+ delete_values({'a'=>'A','b'=>'B','c'=>'C','B'=>'D'}, 'B')
+ Would return: {'a'=>'A','c'=>'C','B'=>'D'}
- Would return: {'a'=>'A','c'=>'C','B'=>'D'}
+ > *Note:*
+ Since Puppet 4.0.0 the equivalent can be performed with the
+ built-in [`filter`](https://puppet.com/docs/puppet/latest/function.html#filter) function:
+ $array.filter |$val| { $val != 'B' }
+ $hash.filter |$key, $val| { $val != 'B' }
- Note that since Puppet 4.0.0 the equivalent can be performed with the filter() function in Puppet:
-
- $array.filter |$val| { $val != 'B' }
- $hash.filter |$key, $val| { $val != 'B' }
-
- DOC
+ @return [Hash] The given hash now missing all instances of the targeted value
+ DOC
) do |arguments|
raise(Puppet::ParseError, "delete_values(): Wrong number of arguments given (#{arguments.size} of 2)") if arguments.size != 2
) do |arguments|
raise(Puppet::ParseError, "delete_values(): Wrong number of arguments given (#{arguments.size} of 2)") if arguments.size != 2