Class: EmailInquire::Validator::EmailFormat
- Defined in:
- lib/email_inquire/validator/email_format.rb
Constant Summary collapse
- DOMAIN_REGEXP =
/ \A (?: (?= [a-z0-9-]{1,63} \. ) [a-z0-9]+ (?: - [a-z0-9]+ )* \. ){1,8} [a-z]{2,63} \z /x.freeze
- NAME_ALLOWED_CHARS =
/[a-z0-9._%+-]/.freeze
- NAME_REGEXP =
/ \A [a-z0-9] [#{NAME_ALLOWED_CHARS}]{0,63} \z /x.freeze
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#validate ⇒ Object
Relevant literature: emailregex.com/email-validation-summary/ www.regular-expressions.info/email.html.
Methods inherited from Base
Constructor Details
This class inherits a constructor from EmailInquire::Validator::Base
Instance Method Details
#validate ⇒ Object
Relevant literature: emailregex.com/email-validation-summary/ www.regular-expressions.info/email.html
40 41 42 |
# File 'lib/email_inquire/validator/email_format.rb', line 40 def validate response.invalid! if !email || email.length > 255 || !name_valid? || !domain_valid? end |