Class: Owasp::Esapi::Validator::Email
- Inherits:
-
GenericValidator
- Object
- GenericValidator
- Owasp::Esapi::Validator::Email
- Defined in:
- lib/validator/email.rb
Constant Summary collapse
- EMAIL_REGEX =
"^(\\w)+[@](\\w)+[.]\\w{3}$"
Instance Attribute Summary collapse
-
#validate_tld ⇒ Object
readonly
In order to make a strong validation for email addresses, it might be a good idea to make a check for the domain tld.
Attributes inherited from GenericValidator
Instance Method Summary collapse
-
#initialize(options = nil) ⇒ Email
constructor
A new instance of Email.
Methods inherited from GenericValidator
Constructor Details
#initialize(options = nil) ⇒ Email
Returns a new instance of Email.
14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/validator/email.rb', line 14 def initialize(=nil) validate_tld = false @matcher = EMAIL_REGEX super(@matcher) unless .nil? if .has_key? "validate_tld" validate_tld = ["validate_tld"] end end end |
Instance Attribute Details
#validate_tld ⇒ Object (readonly)
In order to make a strong validation for email addresses, it might be a good idea to make a check for the domain tld. This is a very optional and beta feature, so it is turned off by default.
12 13 14 |
# File 'lib/validator/email.rb', line 12 def validate_tld @validate_tld end |