Class: UUIDValidator
- Inherits:
-
ActiveModel::EachValidator
- Object
- ActiveModel::EachValidator
- UUIDValidator
- Defined in:
- lib/openvas-cli/uuid_validator.rb
Overview
Validates a OpenVAS UUID
Instance Method Summary collapse
Instance Method Details
#validate_each(record, attribute, value) ⇒ Object
5 6 7 8 |
# File 'lib/openvas-cli/uuid_validator.rb', line 5 def validate_each(record, attribute, value) record.errors[attribute] << ([:message] || "is not a valid UUID") unless value =~ /\A[0-9abcdef\-]{1,40}\z/i end |