X-Git-Url: https://review.fuel-infra.org/gitweb?a=blobdiff_plain;f=plugins%2Fmcollective%2Fvalidator%2Farray_validator.rb;fp=plugins%2Fmcollective%2Fvalidator%2Farray_validator.rb;h=ed119f8e54d1fd7c4afd49795e2ed87b8ede619f;hb=b87d2f4e68281062df1913440ca5753ae63314a9;hp=0000000000000000000000000000000000000000;hpb=ab0ea530b8ac956091f17b104ab2311336cfc250;p=packages%2Fprecise%2Fmcollective.git diff --git a/plugins/mcollective/validator/array_validator.rb b/plugins/mcollective/validator/array_validator.rb new file mode 100644 index 0000000..ed119f8 --- /dev/null +++ b/plugins/mcollective/validator/array_validator.rb @@ -0,0 +1,9 @@ +module MCollective + module Validator + class ArrayValidator + def self.validate(validator, array) + raise ValidatorError, "value should be one of %s" % [ array.join(", ") ] unless array.include?(validator) + end + end + end +end