Class: Cliqr::ArgumentValidation::ArgumentTypeValidator Private
- Inherits:
-
Object
- Object
- Cliqr::ArgumentValidation::ArgumentTypeValidator
- Defined in:
- lib/cliqr/argument_validation/argument_type_validator.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Validates type of a argument
Instance Method Summary collapse
-
#validate(argument, option, errors) ⇒ Cliqr:ValidationErrors
private
Run the validation on a argument based on the option’s configuration.
Instance Method Details
#validate(argument, option, errors) ⇒ Cliqr:ValidationErrors
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Run the validation on a argument based on the option’s configuration
9 10 11 12 13 |
# File 'lib/cliqr/argument_validation/argument_type_validator.rb', line 9 def validate(argument, option, errors) errors.add("only values of type '#{option.type}' allowed for option '#{option.name}'") \ unless type_of?(argument, option.type) errors end |