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

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

    return args.min
  end
end