Class: EmailChecker::Checker

Inherits:
Object
  • Object
show all
Defined in:
lib/email_checker/checker.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(email) ⇒ Checker

Returns a new instance of Checker.



7
8
9
10
11
# File 'lib/email_checker/checker.rb', line 7

def initialize(email)
  @email = email
  email_m = email.match(EMAIL_PATTERN)
  @domain = Domain.new(email_m[2])
end

Instance Attribute Details

#domainObject (readonly)

Returns the value of attribute domain.



5
6
7
# File 'lib/email_checker/checker.rb', line 5

def domain
  @domain
end

Instance Method Details

#email_exists_in_server?Boolean

Returns:

  • (Boolean)


13
14
15
16
17
18
19
20
# File 'lib/email_checker/checker.rb', line 13

def email_exists_in_server?
  mailfrom if EmailChecker.config.verifier_domain
  rcptto.tap do
    close_connection
  end
ensure
  close_connection
end