Class: GitHubPages::HealthCheck::Resolver
- Inherits:
-
Object
- Object
- GitHubPages::HealthCheck::Resolver
- Defined in:
- lib/github-pages-health-check/resolver.rb
Constant Summary collapse
- DEFAULT_RESOLVER_OPTIONS =
{ :retry_times => 2, :query_timeout => 5, :dnssec => false, :do_caching => false }.freeze
- PUBLIC_NAMESERVERS =
%w( 8.8.8.8 1.1.1.1 ).freeze
Instance Attribute Summary collapse
-
#domain ⇒ Object
readonly
Returns the value of attribute domain.
-
#nameservers ⇒ Object
readonly
Returns the value of attribute nameservers.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(domain, nameservers: :default) ⇒ Resolver
constructor
Create a new resolver.
- #query(type) ⇒ Object
Constructor Details
#initialize(domain, nameservers: :default) ⇒ Resolver
Create a new resolver.
domain - the domain we’re getting answers for nameserver - (optional) a case
29 30 31 32 |
# File 'lib/github-pages-health-check/resolver.rb', line 29 def initialize(domain, nameservers: :default) @domain = domain @nameservers = nameservers end |
Instance Attribute Details
#domain ⇒ Object (readonly)
Returns the value of attribute domain.
23 24 25 |
# File 'lib/github-pages-health-check/resolver.rb', line 23 def domain @domain end |
#nameservers ⇒ Object (readonly)
Returns the value of attribute nameservers.
23 24 25 |
# File 'lib/github-pages-health-check/resolver.rb', line 23 def nameservers @nameservers end |
Class Method Details
.default_resolver ⇒ Object
18 19 20 |
# File 'lib/github-pages-health-check/resolver.rb', line 18 def default_resolver @default_resolver ||= Dnsruby::Resolver.new(DEFAULT_RESOLVER_OPTIONS) end |
Instance Method Details
#query(type) ⇒ Object
34 35 36 |
# File 'lib/github-pages-health-check/resolver.rb', line 34 def query(type) resolver.query(Addressable::IDNA.to_ascii(domain), type).answer end |