X-Git-Url: https://git.adam-barratt.org.uk/?p=mirror%2Fdsa-puppet.git;a=blobdiff_plain;f=3rdparty%2Fmodules%2Fstdlib%2Flib%2Fpuppet%2Fparser%2Ffunctions%2Fhash.rb;h=484cb59bfaeb45cb5d3669af3db665a90a9817fa;hp=0162e8327ee77748e63224c05bcba783ea7d26ee;hb=30caaa85aed7015ca0d77216bff175eebd917eb7;hpb=6f656bd4265e3dab13b9af2bf96e9044322e9d8f diff --git a/3rdparty/modules/stdlib/lib/puppet/parser/functions/hash.rb b/3rdparty/modules/stdlib/lib/puppet/parser/functions/hash.rb index 0162e8327..484cb59bf 100644 --- a/3rdparty/modules/stdlib/lib/puppet/parser/functions/hash.rb +++ b/3rdparty/modules/stdlib/lib/puppet/parser/functions/hash.rb @@ -3,20 +3,22 @@ # module Puppet::Parser::Functions newfunction(:hash, :type => :rvalue, :doc => <<-DOC - This function converts an array into a hash. + @summary + **Deprecated:** This function converts an array into a hash. - *Examples:* + @return + the converted array as a hash + @example Example Usage: + hash(['a',1,'b',2,'c',3]) # Returns: {'a'=>1,'b'=>2,'c'=>3} - hash(['a',1,'b',2,'c',3]) - - Would return: {'a'=>1,'b'=>2,'c'=>3} - - Note: Since Puppet 5.0.0 type conversions can in general be performed by using the Puppet Type System. - See the function new() in Puppet for a wide range of available type conversions. + > **Note:** This function has been replaced with the built-in ability to create a new value of almost any + data type - see the built-in [`Hash.new`](https://puppet.com/docs/puppet/latest/function.html#conversion-to-hash-and-struct) function + in Puppet. This example shows the equivalent expression in the Puppet language: - - Hash(['a',1,'b',2,'c',3]) - Hash([['a',1],['b',2],['c',3]]) + ``` + Hash(['a',1,'b',2,'c',3]) + Hash([['a',1],['b',2],['c',3]]) + ``` DOC ) do |arguments|