Class: MCollective::Validator::LengthValidator

Inherits:
Object
  • Object
show all
Defined in:
lib/mcollective/validator/length_validator.rb

Class Method Summary collapse

Class Method Details

.validate(validator, length) ⇒ Object



4
5
6
7
8
# File 'lib/mcollective/validator/length_validator.rb', line 4

def self.validate(validator, length)
  if (validator.size > length) && (length > 0)
    raise ValidatorError, "Input string is longer than #{length} character(s)"
  end
end