X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=3rdparty%2Fmodules%2Fstdlib%2Flib%2Fpuppet%2Fparser%2Ffunctions%2Fround.rb;h=12067bad9fcd6de313add22fa14b9aaa28c197f8;hb=30caaa85aed7015ca0d77216bff175eebd917eb7;hp=489c3014dc7c51d5e9d96c73cdd4cf45791ad390;hpb=6963202b4b62c2816655ac9532521b018fdf83bd;p=mirror%2Fdsa-puppet.git diff --git a/3rdparty/modules/stdlib/lib/puppet/parser/functions/round.rb b/3rdparty/modules/stdlib/lib/puppet/parser/functions/round.rb index 489c3014d..12067bad9 100644 --- a/3rdparty/modules/stdlib/lib/puppet/parser/functions/round.rb +++ b/3rdparty/modules/stdlib/lib/puppet/parser/functions/round.rb @@ -1,23 +1,24 @@ # # round.rb # - module Puppet::Parser::Functions - newfunction(:round, :type => :rvalue, :doc => <<-EOS - Rounds a number to the nearest integer - - *Examples:* + newfunction(:round, :type => :rvalue, :doc => <<-DOC + @summary + Rounds a number to the nearest integer - round(2.9) + @return + the rounded value as integer - returns: 3 + @example - round(2.4) + ```round(2.9)``` returns ```3``` - returns: 2 + ```round(2.4)``` returns ```2``` - EOS - ) do |args| + > *Note:* from Puppet 6.0.0, the compatible function with the same name in Puppet core + will be used instead of this function. + DOC + ) do |args| raise Puppet::ParseError, "round(): Wrong number of arguments given #{args.size} for 1" if args.size != 1 raise Puppet::ParseError, "round(): Expected a Numeric, got #{args[0].class}" unless args[0].is_a? Numeric