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%2Fvalidate_numeric.rb;h=6ccdb0e96869dff95fc3c58144a477b923359710;hp=803e6f01a6b71259d9382d4536b5396fda87c897;hb=30caaa85aed7015ca0d77216bff175eebd917eb7;hpb=6f656bd4265e3dab13b9af2bf96e9044322e9d8f diff --git a/3rdparty/modules/stdlib/lib/puppet/parser/functions/validate_numeric.rb b/3rdparty/modules/stdlib/lib/puppet/parser/functions/validate_numeric.rb index 803e6f01a..6ccdb0e96 100644 --- a/3rdparty/modules/stdlib/lib/puppet/parser/functions/validate_numeric.rb +++ b/3rdparty/modules/stdlib/lib/puppet/parser/functions/validate_numeric.rb @@ -2,21 +2,23 @@ # validate_numeric.rb # module Puppet::Parser::Functions - newfunction(:validate_numeric, :doc => <<-'DOC') do |args| - Validate that the first argument is a numeric value (or an array of numeric values). Abort catalog compilation if any of the checks fail. + newfunction(:validate_numeric, :doc => <<-DOC + @summary + Validate that the first argument is a numeric value (or an array of numeric values). Abort catalog compilation if any of the checks fail. The second argument is optional and passes a maximum. (All elements of) the first argument has to be less or equal to this max. - The third argument is optional and passes a minimum. (All elements of) the first argument has to be greater or equal to this min. If, and only if, a minimum is given, the second argument may be an empty string or undef, which will be handled to just check if (all elements of) the first argument are greater or equal to the given minimum. - It will fail if the first argument is not a numeric (Integer or Float) or array of numerics, and if arg 2 and arg 3 are not convertable to a numeric. + @return + Validate that the first argument is a numeric value (or an array of numeric values). Fail compilation if any of the checks fail. + For passing and failing usage, see `validate_integer()`. It is all the same for validate_numeric, yet now floating point values are allowed, too. DOC - + ) do |args| function_deprecation([:validate_numeric, 'This method is deprecated, please use the stdlib validate_legacy function, with Stdlib::Compat::Numeric. There is further documentation for validate_legacy function in the README.'])