Class: EmailDomainChecker::DnsResolver
- Inherits:
-
Object
- Object
- EmailDomainChecker::DnsResolver
- Defined in:
- lib/email_domain_checker/dns_resolver.rb
Instance Attribute Summary collapse
-
#timeout ⇒ Object
readonly
Returns the value of attribute timeout.
Instance Method Summary collapse
- #has_a_record?(domain) ⇒ Boolean
- #has_mx_record?(domain) ⇒ Boolean
-
#initialize(timeout: 5, cache: nil) ⇒ DnsResolver
constructor
A new instance of DnsResolver.
Constructor Details
#initialize(timeout: 5, cache: nil) ⇒ DnsResolver
Returns a new instance of DnsResolver.
10 11 12 13 |
# File 'lib/email_domain_checker/dns_resolver.rb', line 10 def initialize(timeout: 5, cache: nil) @timeout = timeout @cache = cache end |
Instance Attribute Details
#timeout ⇒ Object (readonly)
Returns the value of attribute timeout.
8 9 10 |
# File 'lib/email_domain_checker/dns_resolver.rb', line 8 def timeout @timeout end |
Instance Method Details
#has_a_record?(domain) ⇒ Boolean
19 20 21 |
# File 'lib/email_domain_checker/dns_resolver.rb', line 19 def has_a_record?(domain) has_record?(domain, "a", Resolv::DNS::Resource::IN::A) end |
#has_mx_record?(domain) ⇒ Boolean
15 16 17 |
# File 'lib/email_domain_checker/dns_resolver.rb', line 15 def has_mx_record?(domain) has_record?(domain, "mx", Resolv::DNS::Resource::IN::MX) end |