Class: EmailVeracity::Domain
- Inherits:
-
Object
- Object
- EmailVeracity::Domain
- Includes:
- Validatability
- Defined in:
- lib/email_veracity/domain.rb
Class Method Summary collapse
Instance Method Summary collapse
- #address_servers ⇒ Object
- #blacklisted? ⇒ Boolean
- #exchange_servers ⇒ Object
-
#initialize(name = '') ⇒ Domain
constructor
A new instance of Domain.
- #name ⇒ Object
- #servers ⇒ Object
- #to_s ⇒ Object
- #whitelisted? ⇒ Boolean
Methods included from Validatability
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
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
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_servers ⇒ Object
34 35 36 |
# File 'lib/email_veracity/domain.rb', line 34 def address_servers @address_servers ||= servers_in(:a) end |
#blacklisted? ⇒ Boolean
30 31 32 |
# File 'lib/email_veracity/domain.rb', line 30 def blacklisted? Domain.blacklisted?(name) end |
#exchange_servers ⇒ Object
38 39 40 |
# File 'lib/email_veracity/domain.rb', line 38 def exchange_servers @exchange_servers ||= servers_in(:mx) end |
#name ⇒ Object
22 23 24 |
# File 'lib/email_veracity/domain.rb', line 22 def name @name.to_s.downcase.strip end |
#servers ⇒ Object
42 43 44 |
# File 'lib/email_veracity/domain.rb', line 42 def servers address_servers + exchange_servers end |
#to_s ⇒ Object
18 19 20 |
# File 'lib/email_veracity/domain.rb', line 18 def to_s name end |
#whitelisted? ⇒ Boolean
26 27 28 |
# File 'lib/email_veracity/domain.rb', line 26 def whitelisted? Domain.whitelisted?(name) end |