Class: OIDValidator

Inherits:
ActiveModel::EachValidator
  • Object
show all
Defined in:
lib/openvas-cli/oid_validator.rb

Overview

Validates an OpenVAS OID Used by: VasNVT

Instance Method Summary collapse

Instance Method Details

#validate_each(record, attribute, value) ⇒ Object



6
7
8
9
# File 'lib/openvas-cli/oid_validator.rb', line 6

def validate_each(record, attribute, value)
  record.errors[attribute] << (options[:message] || "is not a valid UUID") unless
    value =~ /\A[0-9\.]{1,80}\z/
end