Class: Itdis
Overview
The class used for resolving domains
Constant Summary
Constants included from ItdisVersion
Instance Attribute Summary collapse
Instance Method Summary collapse
-
#check ⇒ Hash
Check if the domains of the instance are in the scope.
-
#initialize(scope, domains) ⇒ Itdis
constructor
A new instance of resolver.
Constructor Details
#initialize(scope, domains) ⇒ Itdis
A new instance of resolver
56 57 58 59 |
# File 'lib/itdis.rb', line 56 def initialize(scope, domains) self.scope = scope self.domains = domains end |
Instance Attribute Details
#domains ⇒ Array<String> #domains=(domains) ⇒ Array<String>
39 40 41 |
# File 'lib/itdis.rb', line 39 def domains @domains end |
#scope ⇒ Array<String> #scope( = scope) ⇒ Array<String>
26 27 28 |
# File 'lib/itdis.rb', line 26 def scope @scope end |
Instance Method Details
#check ⇒ Hash
Check if the domains of the instance are in the scope
67 68 69 70 71 72 73 74 75 76 77 78 79 |
# File 'lib/itdis.rb', line 67 def check checked = {} @domains.each do |domain| ips = {} Resolv.each_address(domain.chomp) do |ip| is_in_scope = false is_in_scope = true if @scope.include?(ip) ips.store(ip, is_in_scope) end checked.store(domain, ips) end return checked end |