X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=3rdparty%2Fmodules%2Fstdlib%2Flib%2Fpuppet%2Fparser%2Ffunctions%2Fvalues.rb;h=434ce6c91e43a19ded89c79ca281577358376931;hb=30caaa85aed7015ca0d77216bff175eebd917eb7;hp=16067561b4006d684315a7577199cd2911a05060;hpb=ad88f67c13ae0f1a08936dad643f1e3509ab5f40;p=mirror%2Fdsa-puppet.git diff --git a/3rdparty/modules/stdlib/lib/puppet/parser/functions/values.rb b/3rdparty/modules/stdlib/lib/puppet/parser/functions/values.rb index 16067561b..434ce6c91 100644 --- a/3rdparty/modules/stdlib/lib/puppet/parser/functions/values.rb +++ b/3rdparty/modules/stdlib/lib/puppet/parser/functions/values.rb @@ -1,28 +1,32 @@ # # values.rb # - module Puppet::Parser::Functions - newfunction(:values, :type => :rvalue, :doc => <<-EOS -When given a hash this function will return the values of that hash. + newfunction(:values, :type => :rvalue, :doc => <<-DOC + @summary + When given a hash this function will return the values of that hash. + + @return + array of values -*Examples:* + @example **Usage** + $hash = { + 'a' => 1, + 'b' => 2, + 'c' => 3, + } + values($hash) - $hash = { - 'a' => 1, - 'b' => 2, - 'c' => 3, - } - values($hash) + This example would return: ```[1,2,3]``` -This example would return: + > *Note:* + From Puppet 5.5.0, the compatible function with the same name in Puppet core + will be used instead of this function. - [1,2,3] - EOS - ) do |arguments| + DOC + ) do |arguments| - raise(Puppet::ParseError, "values(): Wrong number of arguments " + - "given (#{arguments.size} for 1)") if arguments.size < 1 + raise(Puppet::ParseError, "values(): Wrong number of arguments given (#{arguments.size} for 1)") if arguments.empty? hash = arguments[0]