#
module Puppet::Parser::Functions
newfunction(:suffix, :type => :rvalue, :doc => <<-DOC
- This function applies a suffix to all elements in an array, or to the keys
- in a hash.
+ @summary
+ This function applies a suffix to all elements in an array, or to the keys
+ in a hash.
- *Examples:*
+ @return
+ Array or Hash with updated elements containing the passed suffix
- suffix(['a','b','c'], 'p')
+ @example **Usage**
- Will return: ['ap','bp','cp']
+ suffix(['a','b','c'], 'p')
+ Will return: ['ap','bp','cp']
- Note that since Puppet 4.0.0 the general way to modify values is in array is by using the map
+ > *Note:* that 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| { "${x}p" }
+ ```['a', 'b', 'c'].map |$x| { "${x}p" }```
DOC
) do |arguments|