summaryrefslogtreecommitdiff
path: root/lib/puppet/parser/functions/has_key.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/puppet/parser/functions/has_key.rb')
-rw-r--r--lib/puppet/parser/functions/has_key.rb17
1 files changed, 9 insertions, 8 deletions
diff --git a/lib/puppet/parser/functions/has_key.rb b/lib/puppet/parser/functions/has_key.rb
index 9c1c4c3..4657cc2 100644
--- a/lib/puppet/parser/functions/has_key.rb
+++ b/lib/puppet/parser/functions/has_key.rb
@@ -1,16 +1,17 @@
module Puppet::Parser::Functions
newfunction(:has_key, :type => :rvalue, :doc => <<-'ENDHEREDOC') do |args|
- determine if a hash has a certain key value.
+ Determine if a hash has a certain key value.
Example:
- $my_hash = {'key_one' => 'value_one'}
- if has_key($my_hash, 'key_two') {
- notice('we will not reach here')
- }
- if has_key($my_hash, 'key_one') {
- notice('this will be printed')
- }
+
+ $my_hash = {'key_one' => 'value_one'}
+ if has_key($my_hash, 'key_two') {
+ notice('we will not reach here')
+ }
+ if has_key($my_hash, 'key_one') {
+ notice('this will be printed')
+ }
ENDHEREDOC