class HaveAPI::Validator

Base class for all validators.

All validators can have a short and a full form. The short form is used when default configuration is sufficient. Custom settings can be set using the full form.

The short form means the validator is configured as ‘<option> => <single value>`. The full form is `<option> => { hash with configuration options }`.

It is up to each validator what exactly the short form means and what options can be set. Specify only those options that you wish to override. The only common option is ‘message` - the error message sent to the client if the provided value did not pass the validator.

The ‘message` can contain `%{value}`, which is replaced by the actual value that did not pass the validator.