Class: EmailVeracity::Domain

Inherits:
Object
  • Object
show all
Includes:
Validatability
Defined in:
lib/email_veracity/domain.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Validatability

#errors, #valid?

Constructor Details

#initialize(name = '') ⇒ Domain

Returns a new instance of Domain.



14
15
16
# File 'lib/email_veracity/domain.rb', line 14

def initialize(name = '')
  @name = name
end

Class Method Details

.blacklisted?(name) ⇒ Boolean

Returns:

  • (Boolean)


10
11
12
# File 'lib/email_veracity/domain.rb', line 10

def self.blacklisted?(name)
  Config[:blacklist].include?(name.downcase.strip)
end

.whitelisted?(name) ⇒ Boolean

Returns:

  • (Boolean)


6
7
8
# File 'lib/email_veracity/domain.rb', line 6

def self.whitelisted?(name)
  Config[:whitelist].include?(name.downcase.strip)
end

Instance Method Details

#address_serversObject



34
35
36
# File 'lib/email_veracity/domain.rb', line 34

def address_servers
  @address_servers ||= servers_in(:a)
end

#blacklisted?Boolean

Returns:

  • (Boolean)


30
31
32
# File 'lib/email_veracity/domain.rb', line 30

def blacklisted?
  Domain.blacklisted?(name)
end

#exchange_serversObject



38
39
40
# File 'lib/email_veracity/domain.rb', line 38

def exchange_servers
  @exchange_servers ||= servers_in(:mx)
end

#nameObject



22
23
24
# File 'lib/email_veracity/domain.rb', line 22

def name
  @name.to_s.downcase.strip
end

#serversObject



42
43
44
# File 'lib/email_veracity/domain.rb', line 42

def servers
  address_servers + exchange_servers
end

#to_sObject



18
19
20
# File 'lib/email_veracity/domain.rb', line 18

def to_s
  name
end

#whitelisted?Boolean

Returns:

  • (Boolean)


26
27
28
# File 'lib/email_veracity/domain.rb', line 26

def whitelisted?
  Domain.whitelisted?(name)
end