Class: EmailInquire::Validator::Base
- Inherits:
-
Object
- Object
- EmailInquire::Validator::Base
- Defined in:
- lib/email_inquire/validator/base.rb
Direct Known Subclasses
CommonProvider, CommonProviderMistake, CommonlyMistakenDomain, CommonlyMistakenTld, CountryCodeTld, CustomInvalidDomain, CustomValidDomain, EmailFormat, KnownInvalidDomain, OneTimeProvider, UniqueDomainProvider
Instance Attribute Summary collapse
-
#domain ⇒ Object
readonly
Returns the value of attribute domain.
-
#email ⇒ Object
readonly
Returns the value of attribute email.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(email) ⇒ Base
constructor
A new instance of Base.
- #validate ⇒ Object
Constructor Details
#initialize(email) ⇒ Base
Returns a new instance of Base.
30 31 32 33 |
# File 'lib/email_inquire/validator/base.rb', line 30 def initialize(email) @email = email @name, @domain = email&.split("@", 2) end |
Instance Attribute Details
#domain ⇒ Object (readonly)
Returns the value of attribute domain.
35 36 37 |
# File 'lib/email_inquire/validator/base.rb', line 35 def domain @domain end |
#email ⇒ Object (readonly)
Returns the value of attribute email.
35 36 37 |
# File 'lib/email_inquire/validator/base.rb', line 35 def email @email end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
35 36 37 |
# File 'lib/email_inquire/validator/base.rb', line 35 def name @name end |
Class Method Details
.validate(email) ⇒ Object
12 13 14 |
# File 'lib/email_inquire/validator/base.rb', line 12 def validate(email) new(email).validate end |
Instance Method Details
#validate ⇒ Object
37 38 39 |
# File 'lib/email_inquire/validator/base.rb', line 37 def validate raise NotImplementedError end |