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%2Fprefix.rb;h=b5e96416dbed15b8797d3bd0938e92033f738365;hp=f1e1234b3d052f5c348eb725a403cd6e229f1d6f;hb=30caaa85aed7015ca0d77216bff175eebd917eb7;hpb=6f656bd4265e3dab13b9af2bf96e9044322e9d8f diff --git a/3rdparty/modules/stdlib/lib/puppet/parser/functions/prefix.rb b/3rdparty/modules/stdlib/lib/puppet/parser/functions/prefix.rb index f1e1234b3..b5e96416d 100644 --- a/3rdparty/modules/stdlib/lib/puppet/parser/functions/prefix.rb +++ b/3rdparty/modules/stdlib/lib/puppet/parser/functions/prefix.rb @@ -3,18 +3,19 @@ # module Puppet::Parser::Functions newfunction(:prefix, :type => :rvalue, :doc => <<-DOC - This function applies a prefix to all elements in an array or a hash. + @summary + This function applies a prefix to all elements in an array or a hash. - *Examples:* + @example **Usage** - prefix(['a','b','c'], 'p') + prefix(['a','b','c'], 'p') + Will return: ['pa','pb','pc'] - Will return: ['pa','pb','pc'] - - Note that since Puppet 4.0.0 the general way to modify values is in array is by using the map + > *Note:* since Puppet 4.0.0 the general way to modify values is in array is by using the map function in Puppet. This example does the same as the example above: + ['a', 'b', 'c'].map |$x| { "p${x}" } - ['a', 'b', 'c'].map |$x| { "p${x}" } + @return [Hash] or [Array] The passed values now contains the passed prefix DOC ) do |arguments|