1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
module AsyncDNS
class Settings
@local_domain : String?
property static_hosts, nameservers, local_domain, search_domains, uses_tcp
getter timeout, max_attempts, abs_num_dots
def timeout=(timeout)
raise ArgumentError.new("timeout must be positive") if timeout < 0
@timeout = timeout
end
def max_attempts=(max_attempts)
if max_attempts < 0
raise ArgumentError.new("max_attempts must be positive")
|
|
>
|
>
|
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
module AsyncDNS
class Settings
@local_domain : String?
property :static_hosts, :nameservers, :local_domain, :search_domains,
:uses_tcp, :reload_period
getter :timeout, :max_attempts, :abs_num_dots
def timeout=(timeout)
if timeout < Time::Span.zero
raise ArgumentError.new("timeout must be positive")
end
@timeout = timeout
end
def max_attempts=(max_attempts)
if max_attempts < 0
raise ArgumentError.new("max_attempts must be positive")
|