rbs 1.2.0 → 1.3.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (55) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ruby.yml +5 -1
  3. data/.gitignore +2 -0
  4. data/CHANGELOG.md +53 -0
  5. data/README.md +1 -1
  6. data/Rakefile +9 -0
  7. data/Steepfile +1 -0
  8. data/core/array.rbs +1 -1
  9. data/core/basic_object.rbs +1 -1
  10. data/core/io.rbs +1 -1
  11. data/core/kernel.rbs +2 -2
  12. data/core/marshal.rbs +4 -3
  13. data/docs/rbs_by_example.md +328 -0
  14. data/docs/sigs.md +3 -1
  15. data/docs/stdlib.md +1 -1
  16. data/docs/syntax.md +0 -3
  17. data/lib/rbs/definition_builder.rb +2 -18
  18. data/lib/rbs/definition_builder/ancestor_builder.rb +9 -2
  19. data/lib/rbs/errors.rb +36 -0
  20. data/lib/rbs/parser.rb +913 -892
  21. data/lib/rbs/parser.y +10 -6
  22. data/lib/rbs/prototype/rb.rb +7 -3
  23. data/lib/rbs/prototype/runtime.rb +118 -42
  24. data/lib/rbs/version.rb +1 -1
  25. data/rbs.gemspec +1 -1
  26. data/sig/ancestor_builder.rbs +2 -0
  27. data/sig/errors.rbs +15 -0
  28. data/sig/namespace.rbs +1 -1
  29. data/sig/polyfill.rbs +0 -18
  30. data/stdlib/dbm/0/dbm.rbs +43 -30
  31. data/stdlib/mutex_m/0/mutex_m.rbs +1 -1
  32. data/stdlib/net-http/0/net-http.rbs +1846 -0
  33. data/stdlib/optparse/0/optparse.rbs +1214 -0
  34. data/stdlib/resolv/0/resolv.rbs +1504 -0
  35. data/stdlib/socket/0/addrinfo.rbs +469 -0
  36. data/stdlib/socket/0/basic_socket.rbs +503 -0
  37. data/stdlib/socket/0/ip_socket.rbs +72 -0
  38. data/stdlib/socket/0/socket.rbs +2687 -0
  39. data/stdlib/socket/0/tcp_server.rbs +177 -0
  40. data/stdlib/socket/0/tcp_socket.rbs +35 -0
  41. data/stdlib/socket/0/udp_socket.rbs +111 -0
  42. data/stdlib/socket/0/unix_server.rbs +154 -0
  43. data/stdlib/socket/0/unix_socket.rbs +132 -0
  44. data/stdlib/timeout/0/timeout.rbs +5 -0
  45. data/steep/Gemfile.lock +12 -12
  46. metadata +16 -12
  47. data/bin/annotate-with-rdoc +0 -153
  48. data/bin/console +0 -14
  49. data/bin/query-rdoc +0 -103
  50. data/bin/rbs-prof +0 -9
  51. data/bin/run_in_md.rb +0 -49
  52. data/bin/setup +0 -8
  53. data/bin/sort +0 -89
  54. data/bin/steep +0 -4
  55. data/bin/test_runner.rb +0 -29
@@ -0,0 +1,1504 @@
1
+ #
2
+ #
3
+ # Windows NT
4
+ #
5
+ #
6
+ # Resolv is a thread-aware DNS resolver library written in Ruby. Resolv can
7
+ # handle multiple DNS requests concurrently without blocking the entire Ruby
8
+ # interpreter.
9
+ #
10
+ # See also resolv-replace.rb to replace the libc resolver with Resolv.
11
+ #
12
+ # Resolv can look up various DNS resources using the DNS module directly.
13
+ #
14
+ # Examples:
15
+ #
16
+ # p Resolv.getaddress "www.ruby-lang.org"
17
+ # p Resolv.getname "210.251.121.214"
18
+ #
19
+ # Resolv::DNS.open do |dns|
20
+ # ress = dns.getresources "www.ruby-lang.org", Resolv::DNS::Resource::IN::A
21
+ # p ress.map(&:address)
22
+ # ress = dns.getresources "ruby-lang.org", Resolv::DNS::Resource::IN::MX
23
+ # p ress.map { |r| [r.exchange.to_s, r.preference] }
24
+ # end
25
+ #
26
+ # ## Bugs
27
+ #
28
+ # * NIS is not supported.
29
+ # * /etc/nsswitch.conf is not supported.
30
+ #
31
+ class Resolv
32
+
33
+ # Iterates over all IP addresses for `name`.
34
+ #
35
+ def self.each_address: (String name) { (String) -> void } -> void
36
+
37
+ # Iterates over all hostnames for `address`.
38
+ #
39
+ def self.each_name: (String address) { (String) -> void } -> void
40
+
41
+ # Looks up the first IP address for `name`.
42
+ #
43
+ def self.getaddress: (String name) -> String
44
+
45
+ # Looks up all IP address for `name`.
46
+ #
47
+ def self.getaddresses: (String name) -> Array[String]
48
+
49
+ # Looks up the hostname of `address`.
50
+ #
51
+ def self.getname: (String address) -> String
52
+
53
+ # Looks up all hostnames for `address`.
54
+ #
55
+ def self.getnames: (String address) -> Array[String]
56
+
57
+ public
58
+
59
+ # Iterates over all IP addresses for `name`.
60
+ #
61
+ def each_address: (String name) { (String) -> void } -> void
62
+
63
+ # Iterates over all hostnames for `address`.
64
+ #
65
+ def each_name: (String name) { (String) -> void } -> void
66
+
67
+ # Looks up the first IP address for `name`.
68
+ #
69
+ def getaddress: (String name) -> String
70
+
71
+ # Looks up all IP address for `name`.
72
+ #
73
+ def getaddresses: (String name) -> Array[String]
74
+
75
+ # Looks up the hostname of `address`.
76
+ #
77
+ def getname: (String address) -> String
78
+
79
+ # Looks up all hostnames for `address`.
80
+ #
81
+ def getnames: (String address) -> Array[String]
82
+
83
+ private
84
+
85
+ # Creates a new Resolv using `resolvers`.
86
+ #
87
+ def initialize: (?(Resolv::Hosts | Resolv::DNS) resolvers) -> untyped
88
+ end
89
+
90
+ # Address Regexp to use for matching IP addresses.
91
+ Resolv::AddressRegex: Regexp
92
+
93
+ # Default resolver to use for Resolv class methods.
94
+ Resolv::DefaultResolver: Resolv
95
+
96
+ # Resolv::DNS is a DNS stub resolver.
97
+ #
98
+ # Information taken from the following places:
99
+ #
100
+ # * STD0013
101
+ # * RFC 1035
102
+ # * ftp://ftp.isi.edu/in-notes/iana/assignments/dns-parameters
103
+ # * etc.
104
+ #
105
+ class Resolv::DNS
106
+ type ip_address = Resolv::IPv4 | Resolv::IPv6
107
+
108
+ type dns_name = Name | String
109
+
110
+ def self.allocate_request_id: (String host, Integer port) -> Integer
111
+
112
+ def self.bind_random_port: (UDPSocket udpsock, ?String bind_host) -> void
113
+
114
+ def self.free_request_id: (String host, Integer port, Integer id) -> void
115
+
116
+ # Creates a new DNS resolver. See Resolv::DNS.new for argument details.
117
+ #
118
+ # Yields the created DNS resolver to the block, if given, otherwise returns it.
119
+ #
120
+ def self.open: (*untyped args) -> instance
121
+ | (*untyped args) { (instance) -> void } -> void
122
+
123
+ def self.random: (Integer arg) -> (Integer | Float)
124
+
125
+ public
126
+
127
+ # Closes the DNS resolver.
128
+ #
129
+ def close: () -> untyped
130
+
131
+ # Iterates over all IP addresses for `name` retrieved from the DNS resolver.
132
+ #
133
+ # `name` can be a Resolv::DNS::Name or a String. Retrieved addresses will be a
134
+ # Resolv::IPv4 or Resolv::IPv6
135
+ #
136
+ def each_address: (dns_name name) { (ip_address) -> void } -> void
137
+
138
+ # Iterates over all hostnames for `address` retrieved from the DNS resolver.
139
+ #
140
+ # `address` must be a Resolv::IPv4, Resolv::IPv6 or a String. Retrieved names
141
+ # will be Resolv::DNS::Name instances.
142
+ #
143
+ def each_name: (ip_address | dns_name address) { (Resolv::DNS::Name) -> void } -> void
144
+
145
+ # Iterates over all `typeclass` DNS resources for `name`. See #getresource for
146
+ # argument details.
147
+ #
148
+ def each_resource: (dns_name name, singleton(Resolv::DNS::Query) typeclass) { (Resolv::DNS::Resource) -> void } -> void
149
+
150
+ def extract_resources: (Resolv::DNS::Message msg, dns_name name, singleton(Resolv::DNS::Query) typeclass) { (Resolv::DNS::Resource) -> void } -> void
151
+
152
+ def fetch_resource: (Resolv::DNS::Name name, singleton(Resolv::DNS::Query) typeclass) { (Resolv::DNS::Message, Resolv::DNS::Name) -> void } -> void
153
+
154
+ # Gets the IP address of `name` from the DNS resolver.
155
+ #
156
+ # `name` can be a Resolv::DNS::Name or a String. Retrieved address will be a
157
+ # Resolv::IPv4 or Resolv::IPv6
158
+ #
159
+ def getaddress: (dns_name name) -> ip_address
160
+
161
+ # Gets all IP addresses for `name` from the DNS resolver.
162
+ #
163
+ # `name` can be a Resolv::DNS::Name or a String. Retrieved addresses will be a
164
+ # Resolv::IPv4 or Resolv::IPv6
165
+ #
166
+ def getaddresses: (dns_name name) -> Array[ip_address]
167
+
168
+ # Gets the hostname for `address` from the DNS resolver.
169
+ #
170
+ # `address` must be a Resolv::IPv4, Resolv::IPv6 or a String. Retrieved name
171
+ # will be a Resolv::DNS::Name.
172
+ #
173
+ def getname: (ip_address | dns_name address) -> Resolv::DNS::Name
174
+
175
+ # Gets all hostnames for `address` from the DNS resolver.
176
+ #
177
+ # `address` must be a Resolv::IPv4, Resolv::IPv6 or a String. Retrieved names
178
+ # will be Resolv::DNS::Name instances.
179
+ #
180
+ def getnames: (ip_address | dns_name address) -> [Resolv::DNS::Name]
181
+
182
+ # Look up the `typeclass` DNS resource of `name`.
183
+ #
184
+ # `name` must be a Resolv::DNS::Name or a String.
185
+ #
186
+ # `typeclass` should be one of the following:
187
+ #
188
+ # * Resolv::DNS::Resource::IN::A
189
+ # * Resolv::DNS::Resource::IN::AAAA
190
+ # * Resolv::DNS::Resource::IN::ANY
191
+ # * Resolv::DNS::Resource::IN::CNAME
192
+ # * Resolv::DNS::Resource::IN::HINFO
193
+ # * Resolv::DNS::Resource::IN::MINFO
194
+ # * Resolv::DNS::Resource::IN::MX
195
+ # * Resolv::DNS::Resource::IN::NS
196
+ # * Resolv::DNS::Resource::IN::PTR
197
+ # * Resolv::DNS::Resource::IN::SOA
198
+ # * Resolv::DNS::Resource::IN::TXT
199
+ # * Resolv::DNS::Resource::IN::WKS
200
+ #
201
+ #
202
+ # Returned resource is represented as a Resolv::DNS::Resource instance, i.e.
203
+ # Resolv::DNS::Resource::IN::A.
204
+ #
205
+ def getresource: (dns_name name, singleton(Resolv::DNS::Query) typeclass) -> Resolv::DNS::Resource
206
+
207
+ # Looks up all `typeclass` DNS resources for `name`. See #getresource for
208
+ # argument details.
209
+ #
210
+ def getresources: (dns_name name, singleton(Resolv::DNS::Query) typeclass) -> Array[Resolv::DNS::Resource]
211
+
212
+ def lazy_initialize: () -> untyped
213
+
214
+ def make_tcp_requester: (String host, Integer port) -> Requester::TCP
215
+
216
+ def make_udp_requester: () -> (Requester::ConnectedUDP | Requester::UnconnectedUDP)
217
+
218
+ # Sets the resolver timeouts. This may be a single positive number or an array
219
+ # of positive numbers representing timeouts in seconds. If an array is
220
+ # specified, a DNS request will retry and wait for each successive interval in
221
+ # the array until a successful response is received. Specifying `nil` reverts
222
+ # to the default timeouts:
223
+ # 5, second = 5 * 2 / nameserver_count, 2 * second, 4 * second
224
+ # : Example:
225
+ #
226
+ # dns.timeouts = 3
227
+ #
228
+ #
229
+ def timeouts=: (Integer | Float | Array[Integer | Float] values) -> void
230
+
231
+ private
232
+
233
+ # Creates a new DNS resolver.
234
+ #
235
+ # `config_info` can be:
236
+ #
237
+ # nil
238
+ # : Uses /etc/resolv.conf.
239
+ # String
240
+ # : Path to a file using /etc/resolv.conf's format.
241
+ # Hash
242
+ # : Must contain :nameserver, :search and :ndots keys.
243
+ #
244
+ # :nameserver_port can be used to specify port number of nameserver address.
245
+ #
246
+ # The value of :nameserver should be an address string or an array of address
247
+ # strings.
248
+ # * :nameserver => '8.8.8.8'
249
+ # * :nameserver => ['8.8.8.8', '8.8.4.4']
250
+ #
251
+ #
252
+ # The value of :nameserver_port should be an array of pair of nameserver address
253
+ # and port number.
254
+ # * :nameserver_port => [['8.8.8.8', 53], ['8.8.4.4', 53]]
255
+ #
256
+ #
257
+ # Example:
258
+ #
259
+ # Resolv::DNS.new(:nameserver => ['210.251.121.21'],
260
+ # :search => ['ruby-lang.org'],
261
+ # :ndots => 1)
262
+ #
263
+ def initialize: (?(String | Hash[Symbol, untyped]) config_info) -> untyped
264
+
265
+ def use_ipv6?: () -> untyped
266
+ end
267
+
268
+ # Default DNS Port
269
+ Resolv::DNS::Port: Integer
270
+
271
+ Resolv::DNS::RequestID: Hash[untyped, untyped]
272
+
273
+ Resolv::DNS::RequestIDMutex: Thread::Mutex
274
+
275
+ # Default DNS UDP packet size
276
+ Resolv::DNS::UDPSize: Integer
277
+
278
+ class Resolv::DNS::Config
279
+ def self.default_config_hash: (?String filename) -> Hash[Symbol, untyped]
280
+
281
+ def self.parse_resolv_conf: (String filename) -> Hash[Symbol, untyped]
282
+
283
+ public
284
+
285
+ def generate_candidates: (String name) -> Array[Resolv::DNS::Name]
286
+
287
+ def generate_timeouts: () -> Array[Integer | Float]
288
+
289
+ def lazy_initialize: () -> void
290
+
291
+ def nameserver_port: () -> Array[[String, Integer]]
292
+
293
+ def resolv: (String name) { (Resolv::DNS::Name, Integer, String, Integer) -> void } -> void
294
+
295
+ def single?: () -> [String, Integer]?
296
+
297
+ def timeouts=: (Integer | Float | Array[Integer | Float] values) -> void
298
+
299
+ private
300
+
301
+ def initialize: (?(String | Hash[Symbol, untyped]) config_info) -> untyped
302
+ end
303
+
304
+ Resolv::DNS::Config::InitialTimeout: Integer
305
+
306
+ # Indicates no such domain was found.
307
+ class Resolv::DNS::Config::NXDomain < Resolv::ResolvError
308
+ end
309
+
310
+ # Indicates some other unhandled resolver error was encountered.
311
+ class Resolv::DNS::Config::OtherResolvError < Resolv::ResolvError
312
+ end
313
+
314
+ # Indicates that the DNS response was unable to be decoded.
315
+ class Resolv::DNS::DecodeError < StandardError
316
+ end
317
+
318
+ # Indicates that the DNS request was unable to be encoded.
319
+ class Resolv::DNS::EncodeError < StandardError
320
+ end
321
+
322
+ module Resolv::DNS::Label
323
+ def self.split: (untyped arg) -> untyped
324
+ end
325
+
326
+ class Resolv::DNS::Label::Str
327
+ public
328
+
329
+ def eql?: (Resolv::DNS::Label::Str other) -> bool
330
+
331
+ def downcase: () -> String
332
+
333
+ alias == eql?
334
+
335
+ def hash: () -> Integer
336
+
337
+ def inspect: () -> String
338
+
339
+ def string: () -> String
340
+
341
+ def to_s: () -> String
342
+
343
+ private
344
+
345
+ def initialize: (String string) -> untyped
346
+ end
347
+
348
+ class Resolv::DNS::Message
349
+ def self.decode: (String m) -> instance
350
+
351
+ public
352
+
353
+ def ==: (instance other) -> bool
354
+
355
+ def aa: () -> Integer
356
+
357
+ def aa=: (Integer) -> void
358
+
359
+ def add_additional: (String name, Integer ttl, Resolv::DNS::Resource data) -> void
360
+
361
+ def add_answer: (String name, Integer ttl, Resolv::DNS::Resource data) -> void
362
+
363
+ def add_authority: (String name, Integer ttl, Resolv::DNS::Resource data) -> void
364
+
365
+ def add_question: (String name, singleton(Resolv::DNS::Query) typeclass) -> void
366
+
367
+ def additional: () -> Array[[Resolv::DNS::Name, Integer, Resolv::DNS::Resource]]
368
+
369
+ def answer: () -> Array[[Resolv::DNS::Name, Integer, Resolv::DNS::Resource]]
370
+
371
+ def authority: () -> Array[[Resolv::DNS::Name, Integer, Resolv::DNS::Resource]]
372
+
373
+ def each_additional: () { (Resolv::DNS::Name, Integer, Resolv::DNS::Resource) -> void } -> void
374
+
375
+ def each_answer: () { (Resolv::DNS::Name, Integer, Resolv::DNS::Resource) -> void } -> void
376
+
377
+ def each_authority: () { (Resolv::DNS::Name, Integer, Resolv::DNS::Resource) -> void } -> void
378
+
379
+ def each_question: () { (Resolv::DNS::Name, singleton(Resolv::DNS::Query)) -> void } -> void
380
+
381
+ def each_resource: () { (Resolv::DNS::Name, Integer, Resolv::DNS::Resource) -> void } -> void
382
+
383
+ def encode: () -> String
384
+
385
+ def id: () -> Integer
386
+
387
+ def id=: (Integer) -> void
388
+
389
+ def opcode: () -> Integer
390
+
391
+ def opcode=: (Integer) -> void
392
+
393
+ def qr: () -> Integer
394
+
395
+ def qr=: (Integer) -> void
396
+
397
+ def question: () -> Array[[Resolv::DNS::Name, singleton(Resolv::DNS::Resource)]]
398
+
399
+ def ra: () -> Integer
400
+
401
+ def ra=: (Integer) -> void
402
+
403
+ def rcode: () -> Integer
404
+
405
+ def rcode=: (Integer) -> void
406
+
407
+ def rd: () -> Integer
408
+
409
+ def rd=: (Integer) -> void
410
+
411
+ def tc: () -> Integer
412
+
413
+ def tc=: (Integer) -> void
414
+
415
+ private
416
+
417
+ def initialize: (?Integer id) -> untyped
418
+ end
419
+
420
+ class Resolv::DNS::Message::MessageDecoder
421
+ public
422
+
423
+ def get_bytes: (?Integer len) -> String
424
+
425
+ def get_label: () -> Resolv::DNS::Label::Str
426
+
427
+ def get_labels: () -> Array[Resolv::DNS::Label::Str]
428
+
429
+ def get_length16: () { (Integer) -> Integer } -> Integer
430
+
431
+ def get_name: () -> Resolv::DNS::Name
432
+
433
+ def get_question: () -> Resolv::DNS::Query
434
+
435
+ def get_rr: () -> [Resolv::DNS::Name, Integer, Resolv::DNS::Resource]
436
+
437
+ def get_string: () -> String
438
+
439
+ def get_string_list: () -> Array[String]
440
+
441
+ def get_unpack: (String template) -> Array[untyped]
442
+
443
+ def inspect: () -> String
444
+
445
+ private
446
+
447
+ def initialize: (String data) { (instance) -> void } -> untyped
448
+ end
449
+
450
+ class Resolv::DNS::Message::MessageEncoder
451
+ public
452
+
453
+ def put_bytes: (string d) -> void
454
+
455
+ def put_label: (_ToS d) -> void
456
+
457
+ def put_labels: (Array[_ToS] d) -> void
458
+
459
+ def put_length16: () { () -> void } -> void
460
+
461
+ def put_name: (Resolv::DNS::Name d) -> void
462
+
463
+ def put_pack: (String template, *untyped d) -> void
464
+
465
+ def put_string: (String d) -> void
466
+
467
+ def put_string_list: (_Each[String] ds) -> void
468
+
469
+ def to_s: () -> untyped
470
+
471
+ private
472
+
473
+ def initialize: () -> untyped
474
+ end
475
+
476
+ # A representation of a DNS name.
477
+ class Resolv::DNS::Name
478
+ # Creates a new DNS name from `arg`. `arg` can be:
479
+ #
480
+ # Name
481
+ # : returns `arg`.
482
+ # String
483
+ # : Creates a new Name.
484
+ #
485
+ #
486
+ def self.create: (Resolv::DNS::dns_name arg) -> untyped
487
+
488
+ public
489
+
490
+ def ==: (instance other) -> bool
491
+
492
+ def []: (Integer i) -> Resolv::DNS::Label::Str?
493
+
494
+ # True if this name is absolute.
495
+ #
496
+ def absolute?: () -> bool
497
+
498
+ alias eql? ==
499
+
500
+ def hash: () -> Integer
501
+
502
+ def inspect: () -> String
503
+
504
+ def length: () -> Integer
505
+
506
+ # Returns true if `other` is a subdomain.
507
+ #
508
+ # Example:
509
+ #
510
+ # domain = Resolv::DNS::Name.create("y.z")
511
+ # p Resolv::DNS::Name.create("w.x.y.z").subdomain_of?(domain) #=> true
512
+ # p Resolv::DNS::Name.create("x.y.z").subdomain_of?(domain) #=> true
513
+ # p Resolv::DNS::Name.create("y.z").subdomain_of?(domain) #=> false
514
+ # p Resolv::DNS::Name.create("z").subdomain_of?(domain) #=> false
515
+ # p Resolv::DNS::Name.create("x.y.z.").subdomain_of?(domain) #=> false
516
+ # p Resolv::DNS::Name.create("w.z").subdomain_of?(domain) #=> false
517
+ #
518
+ def subdomain_of?: (instance other) -> bool
519
+
520
+ def to_a: () -> Array[Resolv::DNS::Label::Str]
521
+
522
+ # returns the domain name as a string.
523
+ #
524
+ # The domain name doesn't have a trailing dot even if the name object is
525
+ # absolute.
526
+ #
527
+ # Example:
528
+ #
529
+ # p Resolv::DNS::Name.create("x.y.z.").to_s #=> "x.y.z"
530
+ # p Resolv::DNS::Name.create("x.y.z").to_s #=> "x.y.z"
531
+ #
532
+ def to_s: () -> untyped
533
+
534
+ private
535
+
536
+ def initialize: (Array[Resolv::DNS::Label::Str] labels, ?bool absolute) -> untyped
537
+ end
538
+
539
+ module Resolv::DNS::OpCode
540
+ end
541
+
542
+ Resolv::DNS::OpCode::IQuery: Integer
543
+
544
+ Resolv::DNS::OpCode::Notify: Integer
545
+
546
+ Resolv::DNS::OpCode::Query: Integer
547
+
548
+ Resolv::DNS::OpCode::Status: Integer
549
+
550
+ Resolv::DNS::OpCode::Update: Integer
551
+
552
+ # A DNS query abstract class.
553
+ class Resolv::DNS::Query
554
+ def self.decode_rdata: (Resolv::DNS::Message::MessageDecoder msg) -> instance
555
+
556
+ public
557
+
558
+ def encode_rdata: (Resolv::DNS::Message::MessageEncoder msg) -> void
559
+ end
560
+
561
+ module Resolv::DNS::RCode
562
+ end
563
+
564
+ Resolv::DNS::RCode::BADALG: Integer
565
+
566
+ Resolv::DNS::RCode::BADKEY: Integer
567
+
568
+ Resolv::DNS::RCode::BADMODE: Integer
569
+
570
+ Resolv::DNS::RCode::BADNAME: Integer
571
+
572
+ Resolv::DNS::RCode::BADSIG: Integer
573
+
574
+ Resolv::DNS::RCode::BADTIME: Integer
575
+
576
+ Resolv::DNS::RCode::BADVERS: Integer
577
+
578
+ Resolv::DNS::RCode::FormErr: Integer
579
+
580
+ Resolv::DNS::RCode::NXDomain: Integer
581
+
582
+ Resolv::DNS::RCode::NXRRSet: Integer
583
+
584
+ Resolv::DNS::RCode::NoError: Integer
585
+
586
+ Resolv::DNS::RCode::NotAuth: Integer
587
+
588
+ Resolv::DNS::RCode::NotImp: Integer
589
+
590
+ Resolv::DNS::RCode::NotZone: Integer
591
+
592
+ Resolv::DNS::RCode::Refused: Integer
593
+
594
+ Resolv::DNS::RCode::ServFail: Integer
595
+
596
+ Resolv::DNS::RCode::YXDomain: Integer
597
+
598
+ Resolv::DNS::RCode::YXRRSet: Integer
599
+
600
+ class Resolv::DNS::Requester
601
+ public
602
+
603
+ def close: () -> void
604
+
605
+ def request: (Resolv::DNS::Requester::Sender sender, Numeric tout) -> [Resolv::DNS::Message, String]
606
+
607
+ def sender_for: (String addr, Resolv::DNS::Message msg) -> Resolv::DNS::Requester::Sender
608
+
609
+ private
610
+
611
+ def initialize: () -> untyped
612
+ end
613
+
614
+ class Resolv::DNS::Requester::ConnectedUDP < Resolv::DNS::Requester
615
+ public
616
+
617
+ def close: () -> void
618
+
619
+ def lazy_initialize: () -> void
620
+
621
+ def recv_reply: (Array[UDPSocket] readable_socks) -> [String, String]
622
+
623
+ def sender: (Resolv::DNS::Message msg, String data, ?String host, ?Integer port) -> Resolv::DNS::Requester::Sender
624
+
625
+ private
626
+
627
+ def initialize: (String host, ?Integer port) -> untyped
628
+ end
629
+
630
+ class Resolv::DNS::Requester::ConnectedUDP::Sender < Resolv::DNS::Requester::Sender
631
+ public
632
+
633
+ def data: () -> String
634
+
635
+ def send: () -> void
636
+ end
637
+
638
+ class Resolv::DNS::Requester::MDNSOneShot < Resolv::DNS::Requester::UnconnectedUDP
639
+ public
640
+
641
+ def sender: (Resolv::DNS::Message msg, String data, ?String host, ?Integer port) -> Resolv::DNS::Requester::Sender
642
+
643
+ def recv_reply: (Array[UDPSocket] readable_socks) -> [String, String]
644
+ end
645
+
646
+ # Indicates a problem with the DNS request.
647
+ class Resolv::DNS::Requester::RequestError < StandardError
648
+ end
649
+
650
+ class Resolv::DNS::Requester::Sender
651
+ private
652
+
653
+ def initialize: (Resolv::DNS::Message msg, String data, Socket sock) -> untyped
654
+ end
655
+
656
+ class Resolv::DNS::Requester::TCP < Resolv::DNS::Requester
657
+ public
658
+
659
+ def close: () -> untyped
660
+
661
+ def recv_reply: (Array[TCPSocket] readable_socks) -> [String, String]
662
+
663
+ def sender: (Resolv::DNS::Message msg, String data, ?String host, ?Integer port) -> Resolv::DNS::Requester::Sender
664
+
665
+ private
666
+
667
+ def initialize: (String host, ?Integer port) -> untyped
668
+ end
669
+
670
+ class Resolv::DNS::Requester::TCP::Sender < Resolv::DNS::Requester::Sender
671
+ public
672
+
673
+ def data: () -> String
674
+
675
+ def send: () -> void
676
+ end
677
+
678
+ class Resolv::DNS::Requester::UnconnectedUDP < Resolv::DNS::Requester
679
+ public
680
+
681
+ def close: () -> void
682
+
683
+ def lazy_initialize: () -> void
684
+
685
+ def recv_reply: (Array[UDPSocket] readable_socks) -> [String, String]
686
+
687
+ def sender: (Resolv::DNS::Message msg, String data, ?String host, ?Integer port) -> Resolv::DNS::Requester::Sender
688
+
689
+ private
690
+
691
+ def initialize: (*[String, Integer] nameserver_port) -> untyped
692
+ end
693
+
694
+ class Resolv::DNS::Requester::UnconnectedUDP::Sender < Resolv::DNS::Requester::Sender
695
+ public
696
+
697
+ def data: () -> String
698
+
699
+ def send: () -> void
700
+
701
+ private
702
+
703
+ def initialize: (Resolv::DNS::Message msg, String data, UDPSocket sock, String host, Integer port) -> untyped
704
+ end
705
+
706
+ # A DNS resource abstract class.
707
+ class Resolv::DNS::Resource < Resolv::DNS::Query
708
+ def self.decode_rdata: (Resolv::DNS::Message::MessageDecoder msg) -> instance
709
+
710
+ def self.get_class: (Integer type_value, Integer class_value) -> self
711
+
712
+ public
713
+
714
+ def eql?: (Resolv::DNS::Resource other) -> bool
715
+
716
+ def encode_rdata: (Resolv::DNS::Message::MessageEncoder msg) -> void
717
+
718
+ alias == eql?
719
+
720
+ def hash: () -> Integer
721
+
722
+ # Remaining Time To Live for this Resource.
723
+ #
724
+ def ttl: () -> Integer
725
+ end
726
+
727
+ Resolv::DNS::Resource::ClassHash: Hash[[Integer, Integer], singleton(Resolv::DNS::Resource)]
728
+
729
+ Resolv::DNS::Resource::ClassInsensitiveTypes: Array[singleton(Resolv::DNS::Resource)]
730
+
731
+ Resolv::DNS::Resource::ClassValue: Integer?
732
+
733
+ # A Query type requesting any RR.
734
+ class Resolv::DNS::Resource::ANY < Resolv::DNS::Query
735
+ end
736
+
737
+ Resolv::DNS::Resource::ANY::TypeValue: Integer
738
+
739
+ # The canonical name for an alias.
740
+ class Resolv::DNS::Resource::CNAME < Resolv::DNS::Resource::DomainName
741
+ end
742
+
743
+ Resolv::DNS::Resource::CNAME::TypeValue: Integer
744
+
745
+ # Domain Name resource abstract class.
746
+ class Resolv::DNS::Resource::DomainName < Resolv::DNS::Resource
747
+ def self.decode_rdata: (Resolv::DNS::Message::MessageDecoder msg) -> instance
748
+
749
+ public
750
+
751
+ def encode_rdata: (Resolv::DNS::Message::MessageEncoder msg) -> void
752
+
753
+ # The name of this DomainName.
754
+ #
755
+ def name: () -> String
756
+
757
+ private
758
+
759
+ # Creates a new DomainName from `name`.
760
+ #
761
+ def initialize: (String name) -> untyped
762
+ end
763
+
764
+ # A generic resource abstract class.
765
+ class Resolv::DNS::Resource::Generic < Resolv::DNS::Resource
766
+ def self.create: (Integer type_value, Integer class_value) -> instance
767
+
768
+ def self.decode_rdata: (Resolv::DNS::Message::MessageDecoder msg) -> instance
769
+
770
+ public
771
+
772
+ # Data for this generic resource.
773
+ #
774
+ def data: () -> String
775
+
776
+ def encode_rdata: (Resolv::DNS::Message::MessageEncoder msg) -> void
777
+
778
+ private
779
+
780
+ # Creates a new generic resource.
781
+ #
782
+ def initialize: (String data) -> untyped
783
+ end
784
+
785
+ # Host Information resource.
786
+ class Resolv::DNS::Resource::HINFO < Resolv::DNS::Resource
787
+ def self.decode_rdata: (Resolv::DNS::Message::MessageDecoder msg) -> instance
788
+
789
+ public
790
+
791
+ # CPU architecture for this resource.
792
+ #
793
+ def cpu: () -> String
794
+
795
+ def encode_rdata: (Resolv::DNS::Message::MessageEncoder msg) -> void
796
+
797
+ # Operating system for this resource.
798
+ #
799
+ def os: () -> String
800
+
801
+ private
802
+
803
+ # Creates a new HINFO running `os` on `cpu`.
804
+ #
805
+ def initialize: (String cpu, String os) -> untyped
806
+ end
807
+
808
+ Resolv::DNS::Resource::HINFO::TypeValue: Integer
809
+
810
+ # module IN contains ARPA Internet specific RRs.
811
+ module Resolv::DNS::Resource::IN
812
+ end
813
+
814
+ Resolv::DNS::Resource::IN::ClassValue: Integer
815
+
816
+ # IPv4 Address resource
817
+ class Resolv::DNS::Resource::IN::A < Resolv::DNS::Resource
818
+ def self.decode_rdata: (Resolv::DNS::Message::MessageDecoder msg) -> instance
819
+
820
+ public
821
+
822
+ # The Resolv::IPv4 address for this A.
823
+ #
824
+ def address: () -> Resolv::IPv4
825
+
826
+ def encode_rdata: (Resolv::DNS::Message::MessageEncoder msg) -> void
827
+
828
+ private
829
+
830
+ # Creates a new A for `address`.
831
+ #
832
+ def initialize: (String | Resolv::IPv4 address) -> untyped
833
+ end
834
+
835
+ Resolv::DNS::Resource::IN::A::ClassValue: Integer
836
+
837
+ Resolv::DNS::Resource::IN::A::TypeValue: Integer
838
+
839
+ # An IPv6 address record.
840
+ class Resolv::DNS::Resource::IN::AAAA < Resolv::DNS::Resource
841
+ def self.decode_rdata: (Resolv::DNS::Message::MessageDecoder msg) -> instance
842
+
843
+ public
844
+
845
+ # The Resolv::IPv6 address for this AAAA.
846
+ #
847
+ def address: () -> Resolv::IPv6
848
+
849
+ def encode_rdata: (Resolv::DNS::Message::MessageEncoder msg) -> void
850
+
851
+ private
852
+
853
+ # Creates a new AAAA for `address`.
854
+ #
855
+ def initialize: (String | Resolv::IPv6 address) -> untyped
856
+ end
857
+
858
+ Resolv::DNS::Resource::IN::AAAA::ClassValue: Integer
859
+
860
+ Resolv::DNS::Resource::IN::AAAA::TypeValue: Integer
861
+
862
+ class Resolv::DNS::Resource::IN::ANY < Resolv::DNS::Resource::ANY
863
+ end
864
+
865
+ Resolv::DNS::Resource::IN::ANY::ClassValue: Integer
866
+
867
+ Resolv::DNS::Resource::IN::ANY::TypeValue: Integer
868
+
869
+ class Resolv::DNS::Resource::IN::CNAME < Resolv::DNS::Resource::CNAME
870
+ end
871
+
872
+ Resolv::DNS::Resource::IN::CNAME::ClassValue: Integer
873
+
874
+ Resolv::DNS::Resource::IN::CNAME::TypeValue: Integer
875
+
876
+ class Resolv::DNS::Resource::IN::HINFO < Resolv::DNS::Resource::HINFO
877
+ end
878
+
879
+ Resolv::DNS::Resource::IN::HINFO::ClassValue: Integer
880
+
881
+ Resolv::DNS::Resource::IN::HINFO::TypeValue: Integer
882
+
883
+ class Resolv::DNS::Resource::IN::LOC < Resolv::DNS::Resource::LOC
884
+ end
885
+
886
+ Resolv::DNS::Resource::IN::LOC::ClassValue: Integer
887
+
888
+ Resolv::DNS::Resource::IN::LOC::TypeValue: Integer
889
+
890
+ class Resolv::DNS::Resource::IN::MINFO < Resolv::DNS::Resource::MINFO
891
+ end
892
+
893
+ Resolv::DNS::Resource::IN::MINFO::ClassValue: Integer
894
+
895
+ Resolv::DNS::Resource::IN::MINFO::TypeValue: Integer
896
+
897
+ class Resolv::DNS::Resource::IN::MX < Resolv::DNS::Resource::MX
898
+ end
899
+
900
+ Resolv::DNS::Resource::IN::MX::ClassValue: Integer
901
+
902
+ Resolv::DNS::Resource::IN::MX::TypeValue: Integer
903
+
904
+ class Resolv::DNS::Resource::IN::NS < Resolv::DNS::Resource::NS
905
+ end
906
+
907
+ Resolv::DNS::Resource::IN::NS::ClassValue: Integer
908
+
909
+ Resolv::DNS::Resource::IN::NS::TypeValue: Integer
910
+
911
+ class Resolv::DNS::Resource::IN::PTR < Resolv::DNS::Resource::PTR
912
+ end
913
+
914
+ Resolv::DNS::Resource::IN::PTR::ClassValue: Integer
915
+
916
+ Resolv::DNS::Resource::IN::PTR::TypeValue: Integer
917
+
918
+ class Resolv::DNS::Resource::IN::SOA < Resolv::DNS::Resource::SOA
919
+ end
920
+
921
+ Resolv::DNS::Resource::IN::SOA::ClassValue: Integer
922
+
923
+ Resolv::DNS::Resource::IN::SOA::TypeValue: Integer
924
+
925
+ # SRV resource record defined in RFC 2782
926
+ #
927
+ # These records identify the hostname and port that a service is available at.
928
+ class Resolv::DNS::Resource::IN::SRV < Resolv::DNS::Resource
929
+ def self.decode_rdata: (Resolv::DNS::Message::MessageDecoder msg) -> instance
930
+
931
+ public
932
+
933
+ def encode_rdata: (Resolv::DNS::Message::MessageEncoder msg) -> void
934
+
935
+ # The port on this target host of this service.
936
+ #
937
+ # The range is 0-65535.
938
+ #
939
+ def port: () -> Integer
940
+
941
+ # The priority of this target host.
942
+ #
943
+ # A client MUST attempt to contact the target host with the lowest-numbered
944
+ # priority it can reach; target hosts with the same priority SHOULD be tried in
945
+ # an order defined by the weight field. The range is 0-65535. Note that it is
946
+ # not widely implemented and should be set to zero.
947
+ #
948
+ def priority: () -> Integer
949
+
950
+ # The domain name of the target host.
951
+ #
952
+ # A target of "." means that the service is decidedly not available at this
953
+ # domain.
954
+ #
955
+ def target: () -> String
956
+
957
+ # A server selection mechanism.
958
+ #
959
+ # The weight field specifies a relative weight for entries with the same
960
+ # priority. Larger weights SHOULD be given a proportionately higher probability
961
+ # of being selected. The range of this number is 0-65535. Domain administrators
962
+ # SHOULD use Weight 0 when there isn't any server selection to do, to make the
963
+ # RR easier to read for humans (less noisy). Note that it is not widely
964
+ # implemented and should be set to zero.
965
+ #
966
+ def weight: () -> Integer
967
+
968
+ private
969
+
970
+ # Create a SRV resource record.
971
+ #
972
+ # See the documentation for #priority, #weight, #port and #target for
973
+ # `priority`, `weight`, +port and `target` respectively.
974
+ #
975
+ def initialize: (Integer priority, Integer weight, Integer port, String target) -> untyped
976
+ end
977
+
978
+ Resolv::DNS::Resource::IN::SRV::ClassValue: Integer
979
+
980
+ Resolv::DNS::Resource::IN::SRV::TypeValue: Integer
981
+
982
+ class Resolv::DNS::Resource::IN::TXT < Resolv::DNS::Resource::TXT
983
+ end
984
+
985
+ Resolv::DNS::Resource::IN::TXT::ClassValue: Integer
986
+
987
+ Resolv::DNS::Resource::IN::TXT::TypeValue: Integer
988
+
989
+ # Well Known Service resource.
990
+ class Resolv::DNS::Resource::IN::WKS < Resolv::DNS::Resource
991
+ def self.decode_rdata: (Resolv::DNS::Message::MessageDecoder msg) -> instance
992
+
993
+ public
994
+
995
+ # The host these services run on.
996
+ #
997
+ def address: () -> Resolv::IPv4
998
+
999
+ # A bit map of enabled services on this host.
1000
+ #
1001
+ # If protocol is 6 (TCP) then the 26th bit corresponds to the SMTP service (port
1002
+ # 25). If this bit is set, then an SMTP server should be listening on TCP port
1003
+ # 25; if zero, SMTP service is not supported.
1004
+ #
1005
+ def bitmap: () -> Integer
1006
+
1007
+ def encode_rdata: (Resolv::DNS::Message::MessageEncoder msg) -> void
1008
+
1009
+ # IP protocol number for these services.
1010
+ #
1011
+ def protocol: () -> Integer
1012
+
1013
+ private
1014
+
1015
+ def initialize: (String | Resolv::IPv4 address, Integer protocol, Integer bitmap) -> untyped
1016
+ end
1017
+
1018
+ Resolv::DNS::Resource::IN::WKS::ClassValue: Integer
1019
+
1020
+ Resolv::DNS::Resource::IN::WKS::TypeValue: Integer
1021
+
1022
+ # Location resource
1023
+ class Resolv::DNS::Resource::LOC < Resolv::DNS::Resource
1024
+ def self.decode_rdata: (Resolv::DNS::Message::MessageDecoder msg) -> instance
1025
+
1026
+ public
1027
+
1028
+ # The altitude of the LOC above a reference sphere whose surface sits 100km
1029
+ # below the WGS84 spheroid in centimeters as an unsigned 32bit integer
1030
+ #
1031
+ def altitude: () -> Integer
1032
+
1033
+ def encode_rdata: (Resolv::DNS::Message::MessageEncoder msg) -> void
1034
+
1035
+ # The horizontal precision using ssize type values in meters using scientific
1036
+ # notation as 2 integers of XeY for precision use value/2 e.g. 2m = +/-1m
1037
+ #
1038
+ def hprecision: () -> Integer
1039
+
1040
+ # The latitude for this LOC where 2**31 is the equator in thousandths of an arc
1041
+ # second as an unsigned 32bit integer
1042
+ #
1043
+ def latitude: () -> Integer
1044
+
1045
+ # The longitude for this LOC where 2**31 is the prime meridian in thousandths of
1046
+ # an arc second as an unsigned 32bit integer
1047
+ #
1048
+ def longitude: () -> Integer
1049
+
1050
+ # The spherical size of this LOC in meters using scientific notation as 2
1051
+ # integers of XeY
1052
+ #
1053
+ def ssize: () -> Integer
1054
+
1055
+ # Returns the version value for this LOC record which should always be 00
1056
+ #
1057
+ def version: () -> Integer
1058
+
1059
+ # The vertical precision using ssize type values in meters using scientific
1060
+ # notation as 2 integers of XeY for precision use value/2 e.g. 2m = +/-1m
1061
+ #
1062
+ def vprecision: () -> Integer
1063
+
1064
+ private
1065
+
1066
+ def initialize: (Integer version, Integer ssize, Integer hprecision, Integer vprecision, Integer latitude, Integer longitude, Integer altitude) -> untyped
1067
+ end
1068
+
1069
+ Resolv::DNS::Resource::LOC::TypeValue: Integer
1070
+
1071
+ # Mailing list or mailbox information.
1072
+ class Resolv::DNS::Resource::MINFO < Resolv::DNS::Resource
1073
+ def self.decode_rdata: (Resolv::DNS::Message::MessageDecoder msg) -> instance
1074
+
1075
+ public
1076
+
1077
+ # Mailbox to use for error messages related to the mail list or mailbox.
1078
+ #
1079
+ def emailbx: () -> String
1080
+
1081
+ def encode_rdata: (Resolv::DNS::Message::MessageEncoder msg) -> void
1082
+
1083
+ # Domain name responsible for this mail list or mailbox.
1084
+ #
1085
+ def rmailbx: () -> String
1086
+
1087
+ private
1088
+
1089
+ def initialize: (String rmailbx, String emailbx) -> untyped
1090
+ end
1091
+
1092
+ Resolv::DNS::Resource::MINFO::TypeValue: Integer
1093
+
1094
+ # Mail Exchanger resource.
1095
+ class Resolv::DNS::Resource::MX < Resolv::DNS::Resource
1096
+ def self.decode_rdata: (Resolv::DNS::Message::MessageDecoder msg) -> instance
1097
+
1098
+ public
1099
+
1100
+ def encode_rdata: (Resolv::DNS::Message::MessageEncoder msg) -> void
1101
+
1102
+ # The host of this MX.
1103
+ #
1104
+ def exchange: () -> String
1105
+
1106
+ # The preference for this MX.
1107
+ #
1108
+ def preference: () -> Integer
1109
+
1110
+ private
1111
+
1112
+ # Creates a new MX record with `preference`, accepting mail at `exchange`.
1113
+ #
1114
+ def initialize: (Integer preference, String exchange) -> untyped
1115
+ end
1116
+
1117
+ Resolv::DNS::Resource::MX::TypeValue: Integer
1118
+
1119
+ # An authoritative name server.
1120
+ class Resolv::DNS::Resource::NS < Resolv::DNS::Resource::DomainName
1121
+ end
1122
+
1123
+ Resolv::DNS::Resource::NS::TypeValue: Integer
1124
+
1125
+ # A Pointer to another DNS name.
1126
+ class Resolv::DNS::Resource::PTR < Resolv::DNS::Resource::DomainName
1127
+ end
1128
+
1129
+ Resolv::DNS::Resource::PTR::TypeValue: Integer
1130
+
1131
+ # Start Of Authority resource.
1132
+ class Resolv::DNS::Resource::SOA < Resolv::DNS::Resource
1133
+ def self.decode_rdata: (Resolv::DNS::Message::MessageDecoder msg) -> instance
1134
+
1135
+ public
1136
+
1137
+ def encode_rdata: (Resolv::DNS::Message::MessageEncoder msg) -> void
1138
+
1139
+ # Time in seconds that a secondary name server is to use the data before
1140
+ # refreshing from the primary name server.
1141
+ #
1142
+ def expire: () -> Integer
1143
+
1144
+ # The minimum number of seconds to be used for TTL values in RRs.
1145
+ #
1146
+ def minimum: () -> Integer
1147
+
1148
+ # Name of the host where the master zone file for this zone resides.
1149
+ #
1150
+ def mname: () -> String
1151
+
1152
+ # How often, in seconds, a secondary name server is to check for updates from
1153
+ # the primary name server.
1154
+ #
1155
+ def refresh: () -> Integer
1156
+
1157
+ # How often, in seconds, a secondary name server is to retry after a failure to
1158
+ # check for a refresh.
1159
+ #
1160
+ def retry: () -> Integer
1161
+
1162
+ # The person responsible for this domain name.
1163
+ #
1164
+ def rname: () -> String
1165
+
1166
+ # The version number of the zone file.
1167
+ #
1168
+ def serial: () -> Integer
1169
+
1170
+ private
1171
+
1172
+ # Creates a new SOA record. See the attr documentation for the details of each
1173
+ # argument.
1174
+ #
1175
+ def initialize: (String mname, String rname, Integer serial, Integer refresh, Integer retry_, Integer expire, Integer minimum) -> untyped
1176
+ end
1177
+
1178
+ Resolv::DNS::Resource::SOA::TypeValue: Integer
1179
+
1180
+ # Unstructured text resource.
1181
+ class Resolv::DNS::Resource::TXT < Resolv::DNS::Resource
1182
+ def self.decode_rdata: (Resolv::DNS::Message::MessageDecoder msg) -> instance
1183
+
1184
+ public
1185
+
1186
+ # Returns the concatenated string from `strings`.
1187
+ #
1188
+ def data: () -> String
1189
+
1190
+ def encode_rdata: (Resolv::DNS::Message::MessageEncoder msg) -> void
1191
+
1192
+ # Returns an Array of Strings for this TXT record.
1193
+ #
1194
+ def strings: () -> Array[String]
1195
+
1196
+ private
1197
+
1198
+ def initialize: (String first_string, *String rest_strings) -> untyped
1199
+ end
1200
+
1201
+ Resolv::DNS::Resource::TXT::TypeValue: Integer
1202
+
1203
+ # Resolv::Hosts is a hostname resolver that uses the system hosts file.
1204
+ class Resolv::Hosts
1205
+ public
1206
+
1207
+ # Iterates over all IP addresses for `name` retrieved from the hosts file.
1208
+ #
1209
+ def each_address: (String name) { (String) -> void } -> void
1210
+
1211
+ # Iterates over all hostnames for `address` retrieved from the hosts file.
1212
+ #
1213
+ def each_name: (String address) { (String) -> void } -> void
1214
+
1215
+ # Gets the IP address of `name` from the hosts file.
1216
+ #
1217
+ def getaddress: (String name) -> String
1218
+
1219
+ # Gets all IP addresses for `name` from the hosts file.
1220
+ #
1221
+ def getaddresses: (String name) -> Array[String]
1222
+
1223
+ # Gets the hostname of `address` from the hosts file.
1224
+ #
1225
+ def getname: (String address) -> String
1226
+
1227
+ # Gets all hostnames for `address` from the hosts file.
1228
+ #
1229
+ def getnames: (String address) -> Array[String]
1230
+
1231
+ def lazy_initialize: () -> void
1232
+
1233
+ private
1234
+
1235
+ # Creates a new Resolv::Hosts, using `filename` for its data source.
1236
+ #
1237
+ def initialize: (?String filename) -> untyped
1238
+ end
1239
+
1240
+ Resolv::Hosts::DefaultFileName: String
1241
+
1242
+ # A Resolv::DNS IPv4 address.
1243
+ class Resolv::IPv4
1244
+ def self.create: (String | instance arg) -> instance
1245
+
1246
+ public
1247
+
1248
+ def ==: (instance other) -> bool
1249
+
1250
+ # The raw IPv4 address as a String.
1251
+ #
1252
+ def address: () -> String
1253
+
1254
+ def eql?: (instance other) -> bool
1255
+
1256
+ def hash: () -> Integer
1257
+
1258
+ def inspect: () -> String
1259
+
1260
+ # Turns this IPv4 address into a Resolv::DNS::Name.
1261
+ #
1262
+ def to_name: () -> Resolv::DNS::Name
1263
+
1264
+ def to_s: () -> String
1265
+
1266
+ private
1267
+
1268
+ def initialize: (String address) -> untyped
1269
+ end
1270
+
1271
+ Resolv::IPv4::Regex: Regexp
1272
+
1273
+ # Regular expression IPv4 addresses must match.
1274
+ Resolv::IPv4::Regex256: Regexp
1275
+
1276
+ # A Resolv::DNS IPv6 address.
1277
+ class Resolv::IPv6
1278
+ # Creates a new IPv6 address from `arg` which may be:
1279
+ #
1280
+ # IPv6
1281
+ # : returns `arg`.
1282
+ # String
1283
+ # : `arg` must match one of the IPv6::Regex* constants
1284
+ #
1285
+ #
1286
+ def self.create: (String | instance arg) -> instance
1287
+
1288
+ public
1289
+
1290
+ def ==: (instance other) -> bool
1291
+
1292
+ # The raw IPv6 address as a String.
1293
+ #
1294
+ def address: () -> String
1295
+
1296
+ def eql?: (instance other) -> bool
1297
+
1298
+ def hash: () -> Integer
1299
+
1300
+ def inspect: () -> String
1301
+
1302
+ # Turns this IPv6 address into a Resolv::DNS::Name.
1303
+ #
1304
+ def to_name: () -> Resolv::DNS::Name
1305
+
1306
+ def to_s: () -> String
1307
+
1308
+ private
1309
+
1310
+ def initialize: (untyped address) -> untyped
1311
+ end
1312
+
1313
+ # A composite IPv6 address Regexp.
1314
+ Resolv::IPv6::Regex: Regexp
1315
+
1316
+ # IPv4 mapped IPv6 address format a:b:c:d:e:f:w.x.y.z
1317
+ Resolv::IPv6::Regex_6Hex4Dec: Regexp
1318
+
1319
+ # IPv6 address format a:b:c:d:e:f:g:h
1320
+ Resolv::IPv6::Regex_8Hex: Regexp
1321
+
1322
+ # IPv6 link local address format fe80:b:c:d:e:f:g:h%em1
1323
+ Resolv::IPv6::Regex_8HexLinkLocal: Regexp
1324
+
1325
+ # Compressed IPv6 address format a::b
1326
+ Resolv::IPv6::Regex_CompressedHex: Regexp
1327
+
1328
+ # Compressed IPv4 mapped IPv6 address format a::b:w.x.y.z
1329
+ Resolv::IPv6::Regex_CompressedHex4Dec: Regexp
1330
+
1331
+ # Compressed IPv6 link local address format fe80::b%em1
1332
+ Resolv::IPv6::Regex_CompressedHexLinkLocal: Regexp
1333
+
1334
+ module Resolv::LOC
1335
+ end
1336
+
1337
+ # A Resolv::LOC::Alt
1338
+ class Resolv::LOC::Alt
1339
+ # Creates a new LOC::Alt from `arg` which may be:
1340
+ #
1341
+ # LOC::Alt
1342
+ # : returns `arg`.
1343
+ # String
1344
+ # : `arg` must match the LOC::Alt::Regex constant
1345
+ #
1346
+ #
1347
+ def self.create: (Resolv::LOC::Alt | String arg) -> instance
1348
+
1349
+ public
1350
+
1351
+ def eql?: (Resolv::LOC::Alt other) -> bool
1352
+
1353
+ # The raw altitude
1354
+ #
1355
+ def altitude: () -> Integer
1356
+
1357
+ alias == eql?
1358
+
1359
+ def hash: () -> Integer
1360
+
1361
+ def inspect: () -> String
1362
+
1363
+ def to_s: () -> String
1364
+
1365
+ private
1366
+
1367
+ def initialize: (Integer altitude) -> untyped
1368
+ end
1369
+
1370
+ Resolv::LOC::Alt::Regex: Regexp
1371
+
1372
+ # A Resolv::LOC::Coord
1373
+ class Resolv::LOC::Coord
1374
+ type orientation = "lat" | "lon"
1375
+
1376
+ # Creates a new LOC::Coord from `arg` which may be:
1377
+ #
1378
+ # LOC::Coord
1379
+ # : returns `arg`.
1380
+ # String
1381
+ # : `arg` must match the LOC::Coord::Regex constant
1382
+ #
1383
+ #
1384
+ def self.create: (Resolv::LOC::Coord | String arg) -> instance
1385
+
1386
+ public
1387
+
1388
+ def eql?: (Resolv::LOC::Coord other) -> bool
1389
+
1390
+ # The raw coordinates
1391
+ #
1392
+ def coordinates: () -> String
1393
+
1394
+ alias == eql?
1395
+
1396
+ def hash: () -> Integer
1397
+
1398
+ def inspect: () -> String
1399
+
1400
+ # The orientation of the hemisphere as 'lat' or 'lon'
1401
+ #
1402
+ def orientation: () -> orientation
1403
+
1404
+ def to_s: () -> String
1405
+
1406
+ private
1407
+
1408
+ def initialize: (String coordinates, orientation orientation) -> untyped
1409
+ end
1410
+
1411
+ Resolv::LOC::Coord::Regex: Regexp
1412
+
1413
+ # A Resolv::LOC::Size
1414
+ class Resolv::LOC::Size
1415
+ # Creates a new LOC::Size from `arg` which may be:
1416
+ #
1417
+ # LOC::Size
1418
+ # : returns `arg`.
1419
+ # String
1420
+ # : `arg` must match the LOC::Size::Regex constant
1421
+ #
1422
+ #
1423
+ def self.create: (Resolv::LOC::Size | String arg) -> instance
1424
+
1425
+ public
1426
+
1427
+ def eql?: (Resolv::LOC::Size other) -> bool
1428
+
1429
+ alias == eql?
1430
+
1431
+ def hash: () -> Integer
1432
+
1433
+ def inspect: () -> String
1434
+
1435
+ # The raw size
1436
+ #
1437
+ def scalar: () -> String
1438
+
1439
+ def to_s: () -> String
1440
+
1441
+ private
1442
+
1443
+ def initialize: (String scalar) -> untyped
1444
+ end
1445
+
1446
+ Resolv::LOC::Size::Regex: Regexp
1447
+
1448
+ # Resolv::MDNS is a one-shot Multicast DNS (mDNS) resolver. It blindly makes
1449
+ # queries to the mDNS addresses without understanding anything about multicast
1450
+ # ports.
1451
+ #
1452
+ # Information taken form the following places:
1453
+ #
1454
+ # * RFC 6762
1455
+ #
1456
+ class Resolv::MDNS < Resolv::DNS
1457
+ public
1458
+
1459
+ # Iterates over all IP addresses for `name` retrieved from the mDNS resolver,
1460
+ # provided name ends with "local". If the name does not end in "local" no
1461
+ # records will be returned.
1462
+ #
1463
+ # `name` can be a Resolv::DNS::Name or a String. Retrieved addresses will be a
1464
+ # Resolv::IPv4 or Resolv::IPv6
1465
+ #
1466
+ def each_address: (Resolv::DNS::dns_name name) -> Resolv::DNS::ip_address
1467
+
1468
+ def make_udp_requester: () -> (Resolv::DNS::Requester::ConnectedUDP | Resolv::DNS::Requester::UnconnectedUDP)
1469
+
1470
+ private
1471
+
1472
+ # Creates a new one-shot Multicast DNS (mDNS) resolver.
1473
+ #
1474
+ # `config_info` can be:
1475
+ #
1476
+ # nil
1477
+ # : Uses the default mDNS addresses
1478
+ #
1479
+ # Hash
1480
+ # : Must contain :nameserver or :nameserver_port like Resolv::DNS#initialize.
1481
+ #
1482
+ #
1483
+ def initialize: (?(String | Hash[Symbol, untyped]) config_info) -> untyped
1484
+ end
1485
+
1486
+ # Default IPv4 mDNS address
1487
+ Resolv::MDNS::AddressV4: String
1488
+
1489
+ # Default IPv6 mDNS address
1490
+ Resolv::MDNS::AddressV6: String
1491
+
1492
+ # Default mDNS addresses
1493
+ Resolv::MDNS::Addresses: Array[untyped]
1494
+
1495
+ # Default mDNS Port
1496
+ Resolv::MDNS::Port: Integer
1497
+
1498
+ # Indicates a failure to resolve a name or address.
1499
+ class Resolv::ResolvError < StandardError
1500
+ end
1501
+
1502
+ # Indicates a timeout resolving a name or address.
1503
+ class Resolv::ResolvTimeout < Timeout::Error
1504
+ end