Class: EmailInquire::Validator::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/email_inquire/validator/base.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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

#domainObject (readonly)

Returns the value of attribute domain.



35
36
37
# File 'lib/email_inquire/validator/base.rb', line 35

def domain
  @domain
end

#emailObject (readonly)

Returns the value of attribute email.



35
36
37
# File 'lib/email_inquire/validator/base.rb', line 35

def email
  @email
end

#nameObject (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

#validateObject

Raises:

  • (NotImplementedError)


37
38
39
# File 'lib/email_inquire/validator/base.rb', line 37

def validate
  raise NotImplementedError
end