Class: Openapi3Parser::Validators::Email
- Inherits:
-
Object
- Object
- Openapi3Parser::Validators::Email
- Defined in:
- lib/openapi3_parser/validators/email.rb
Constant Summary collapse
- REGEX =
Regex is sourced from HTML specification: html.spec.whatwg.org/#e-mail-state-(type=email)
%r{ \A [a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+ @ [a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])? (?:.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)* \Z }x
Class Method Summary collapse
Class Method Details
.call(input) ⇒ Object
17 18 19 20 |
# File 'lib/openapi3_parser/validators/email.rb', line 17 def self.call(input) = %("#{input}" is not a valid email address) unless REGEX.match(input) end |