summaryrefslogtreecommitdiff
path: root/lib/puppet/parser/functions/get_default.rb
blob: 3f4359bdab2abb307efb615d04c391071ab7e4c6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# get_default($value, $default) : $value
#
# return $value || $default.
module Puppet::Parser::Functions
    newfunction(:get_default, :type => :rvalue) do |args|
        value = nil
        args.each { |x|
            if ! x.nil? and x.length > 0
                value = x
                break
            end
        }
        return value
    end
end