summaryrefslogtreecommitdiff
path: root/lib/puppet/parser/functions/max.rb
blob: 10b6f7432d67dbd0f8a7f14306c3c51d8c3567ad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
module Puppet::Parser::Functions
  newfunction(:max, :type => :rvalue, :doc => <<-EOS
    Returns the highest value of all arguments.
    Requires at least one argument.
    EOS
  ) do |args|

    raise(Puppet::ParseError, "max(): Wrong number of arguments " +
          "need at least one") if args.size == 0

    return args.max
  end
end