lib/puppet/parameter/value_collection.rb
# Checks if the given value is acceptable (matches one of the literal values or patterns) and returns
# the "matcher" that matched.
# Literal string matchers are tested first, if both a literal and a regexp match would match, the literal
# match wins.
#
# @param test_value [Object] the value to test if it complies with the configured rules
# @return [Puppet::Parameter::Value, nil] The instance of Puppet::Parameter::Value that matched the given value, or nil if there was no match.
# @api private
#
Checks if the given value is acceptable (matches one of the literal values or patterns) and returns
the "matcher" that matched.
Literal string matchers are tested first, if both a literal and a regexp match would match, the literal
match wins.
Checks if the given value is acceptable ( matches one of the literal values or patterns ) and returns the " matcher " that matched . Literal string matchers are tested first if both a literal and a regexp match would match the literal match wins .
def match?(test_value)
    if value = @strings.find { |v| v.match?(test_value) }
      return value
    end
    @regexes.find { |v| v.match?(test_value) }
  end
def match? ( test_value ) if value = @strings . find { | v | v . match? ( test_value ) } return value end @regexes . find { | v | v . match? ( test_value ) } end
Checks if the given value is acceptable (matches one of the literal values or patterns) and returns
the "matcher" that matched.
Checks if the given value is acceptable ( matches one of the literal values or patterns ) and returns the " matcher " that matched .
# First look for normal values # Then look for a regex match
The instance of Puppet::Parameter::Value that matched the given value, or nil if there was no match.
The instance of Puppet :: Parameter :: Value that matched the given value or nil if there was no match .
Puppet::Parameter::Value, nil
test_value
the value to test if it complies with the configured rules
the value to test if it complies with the configured rules
api
None