rbs 2.0.0 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ruby.yml +5 -0
- data/CHANGELOG.md +23 -0
- data/README.md +6 -1
- data/core/array.rbs +2866 -1086
- data/core/basic_object.rbs +150 -30
- data/core/binding.rbs +33 -0
- data/core/builtin.rbs +4 -4
- data/core/class.rbs +43 -5
- data/core/comparable.rbs +57 -0
- data/core/complex.rbs +170 -4
- data/core/constants.rbs +51 -0
- data/core/deprecated.rbs +7 -0
- data/core/dir.rbs +305 -20
- data/core/encoding.rbs +472 -77
- data/core/enumerable.rbs +2173 -234
- data/core/enumerator.rbs +448 -182
- data/core/env.rbs +448 -1
- data/core/errno.rbs +1 -10
- data/core/errors.rbs +152 -2
- data/core/exception.rbs +201 -127
- data/core/false_class.rbs +27 -0
- data/core/fiber.rbs +118 -37
- data/core/fiber_error.rbs +8 -9
- data/core/file.rbs +1059 -139
- data/core/file_test.rbs +287 -32
- data/core/float.rbs +776 -300
- data/core/gc.rbs +185 -34
- data/core/global_variables.rbs +5 -1
- data/core/hash.rbs +1582 -649
- data/core/integer.rbs +974 -204
- data/core/io/buffer.rbs +710 -0
- data/core/io/wait.rbs +29 -8
- data/core/io.rbs +2438 -417
- data/core/kernel.rbs +2315 -316
- data/core/marshal.rbs +37 -2
- data/core/match_data.rbs +123 -6
- data/core/math.rbs +126 -6
- data/core/method.rbs +226 -102
- data/core/module.rbs +421 -45
- data/core/nil_class.rbs +64 -0
- data/core/numeric.rbs +620 -142
- data/core/object.rbs +453 -81
- data/core/object_space.rbs +92 -2
- data/core/proc.rbs +482 -285
- data/core/process.rbs +443 -34
- data/core/ractor.rbs +232 -9
- data/core/random.rbs +151 -52
- data/core/range.rbs +885 -160
- data/core/rational.rbs +122 -6
- data/core/rb_config.rbs +14 -4
- data/core/refinement.rbs +44 -0
- data/core/regexp.rbs +156 -14
- data/core/ruby_vm.rbs +42 -3
- data/core/signal.rbs +78 -39
- data/core/string.rbs +2123 -567
- data/core/string_io.rbs +204 -0
- data/core/struct.rbs +283 -28
- data/core/symbol.rbs +304 -30
- data/core/thread.rbs +1288 -688
- data/core/thread_group.rbs +66 -10
- data/core/time.rbs +643 -217
- data/core/trace_point.rbs +100 -12
- data/core/true_class.rbs +24 -0
- data/core/unbound_method.rbs +73 -7
- data/core/warning.rbs +37 -12
- data/docs/CONTRIBUTING.md +40 -34
- data/docs/stdlib.md +3 -102
- data/lib/rbs/annotate/annotations.rb +197 -0
- data/lib/rbs/annotate/formatter.rb +80 -0
- data/lib/rbs/annotate/rdoc_annotator.rb +398 -0
- data/lib/rbs/annotate/rdoc_source.rb +120 -0
- data/lib/rbs/annotate.rb +6 -0
- data/lib/rbs/cli.rb +45 -1
- data/lib/rbs/definition_builder.rb +5 -1
- data/lib/rbs/location_aux.rb +12 -0
- data/lib/rbs/prototype/rb.rb +12 -0
- data/lib/rbs/version.rb +1 -1
- data/sig/annotate/annotations.rbs +102 -0
- data/sig/annotate/formatter.rbs +24 -0
- data/sig/annotate/rdoc_annotater.rbs +82 -0
- data/sig/annotate/rdoc_source.rbs +30 -0
- data/sig/cli.rbs +2 -0
- data/sig/collection/{collections.rbs → sources.rbs} +0 -0
- data/sig/location.rbs +6 -0
- data/sig/method_types.rbs +5 -1
- data/sig/polyfill.rbs +78 -0
- data/stdlib/abbrev/0/abbrev.rbs +6 -0
- data/stdlib/abbrev/0/array.rbs +26 -0
- data/stdlib/base64/0/base64.rbs +31 -0
- data/stdlib/benchmark/0/benchmark.rbs +74 -3
- data/stdlib/bigdecimal/0/big_decimal.rbs +614 -165
- data/stdlib/bigdecimal-math/0/big_math.rbs +41 -64
- data/stdlib/cgi/0/core.rbs +59 -0
- data/stdlib/coverage/0/coverage.rbs +164 -2
- data/stdlib/csv/0/csv.rbs +2862 -398
- data/stdlib/date/0/date.rbs +483 -25
- data/stdlib/date/0/date_time.rbs +187 -12
- data/stdlib/dbm/0/dbm.rbs +152 -17
- data/stdlib/digest/0/digest.rbs +146 -0
- data/stdlib/erb/0/erb.rbs +65 -245
- data/stdlib/fiber/0/fiber.rbs +73 -91
- data/stdlib/fileutils/0/fileutils.rbs +301 -1
- data/stdlib/find/0/find.rbs +9 -0
- data/stdlib/forwardable/0/forwardable.rbs +65 -1
- data/stdlib/io-console/0/io-console.rbs +227 -15
- data/stdlib/ipaddr/0/ipaddr.rbs +161 -0
- data/stdlib/json/0/json.rbs +1146 -144
- data/stdlib/logger/0/formatter.rbs +24 -0
- data/stdlib/logger/0/log_device.rbs +64 -0
- data/stdlib/logger/0/logger.rbs +165 -13
- data/stdlib/logger/0/period.rbs +10 -0
- data/stdlib/logger/0/severity.rbs +26 -0
- data/stdlib/monitor/0/monitor.rbs +163 -0
- data/stdlib/mutex_m/0/mutex_m.rbs +35 -6
- data/stdlib/net-http/0/net-http.rbs +1492 -683
- data/stdlib/nkf/0/nkf.rbs +372 -0
- data/stdlib/objspace/0/objspace.rbs +149 -90
- data/stdlib/openssl/0/openssl.rbs +8108 -71
- data/stdlib/optparse/0/optparse.rbs +487 -19
- data/stdlib/pathname/0/pathname.rbs +425 -124
- data/stdlib/prettyprint/0/prettyprint.rbs +120 -99
- data/stdlib/prime/0/integer-extension.rbs +20 -2
- data/stdlib/prime/0/prime.rbs +88 -21
- data/stdlib/pstore/0/pstore.rbs +102 -0
- data/stdlib/pty/0/pty.rbs +64 -14
- data/stdlib/resolv/0/resolv.rbs +420 -31
- data/stdlib/rubygems/0/basic_specification.rbs +4 -1
- data/stdlib/rubygems/0/config_file.rbs +33 -1
- data/stdlib/rubygems/0/dependency_installer.rbs +4 -3
- data/stdlib/rubygems/0/installer.rbs +13 -1
- data/stdlib/rubygems/0/path_support.rbs +4 -1
- data/stdlib/rubygems/0/platform.rbs +5 -1
- data/stdlib/rubygems/0/request_set.rbs +44 -2
- data/stdlib/rubygems/0/requirement.rbs +65 -2
- data/stdlib/rubygems/0/rubygems.rbs +407 -0
- data/stdlib/rubygems/0/source_list.rbs +13 -0
- data/stdlib/rubygems/0/specification.rbs +21 -1
- data/stdlib/rubygems/0/stream_ui.rbs +3 -1
- data/stdlib/rubygems/0/uninstaller.rbs +8 -1
- data/stdlib/rubygems/0/version.rbs +60 -157
- data/stdlib/securerandom/0/securerandom.rbs +44 -0
- data/stdlib/set/0/set.rbs +420 -106
- data/stdlib/shellwords/0/shellwords.rbs +55 -77
- data/stdlib/singleton/0/singleton.rbs +20 -0
- data/stdlib/socket/0/addrinfo.rbs +210 -9
- data/stdlib/socket/0/basic_socket.rbs +103 -11
- data/stdlib/socket/0/ip_socket.rbs +31 -9
- data/stdlib/socket/0/socket.rbs +586 -38
- data/stdlib/socket/0/tcp_server.rbs +22 -2
- data/stdlib/socket/0/tcp_socket.rbs +12 -1
- data/stdlib/socket/0/udp_socket.rbs +25 -2
- data/stdlib/socket/0/unix_server.rbs +22 -2
- data/stdlib/socket/0/unix_socket.rbs +45 -5
- data/stdlib/strscan/0/string_scanner.rbs +210 -9
- data/stdlib/tempfile/0/tempfile.rbs +58 -10
- data/stdlib/time/0/time.rbs +208 -116
- data/stdlib/timeout/0/timeout.rbs +10 -0
- data/stdlib/tmpdir/0/tmpdir.rbs +13 -4
- data/stdlib/tsort/0/cyclic.rbs +1 -0
- data/stdlib/tsort/0/interfaces.rbs +1 -0
- data/stdlib/tsort/0/tsort.rbs +42 -0
- data/stdlib/uri/0/common.rbs +57 -8
- data/stdlib/uri/0/file.rbs +55 -109
- data/stdlib/uri/0/ftp.rbs +6 -3
- data/stdlib/uri/0/generic.rbs +556 -327
- data/stdlib/uri/0/http.rbs +26 -115
- data/stdlib/uri/0/https.rbs +8 -102
- data/stdlib/uri/0/ldap.rbs +143 -137
- data/stdlib/uri/0/ldaps.rbs +8 -102
- data/stdlib/uri/0/mailto.rbs +3 -0
- data/stdlib/uri/0/rfc2396_parser.rbs +66 -26
- data/stdlib/uri/0/ws.rbs +6 -3
- data/stdlib/uri/0/wss.rbs +5 -3
- data/stdlib/yaml/0/dbm.rbs +151 -87
- data/stdlib/yaml/0/store.rbs +6 -0
- data/stdlib/zlib/0/zlib.rbs +90 -31
- metadata +17 -5
- data/lib/rbs/location.rb +0 -221
data/stdlib/ipaddr/0/ipaddr.rbs
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
# <!-- rdoc-file=lib/ipaddr.rb -->
|
1
2
|
# IPAddr provides a set of methods to manipulate an IP address. Both IPv4 and
|
2
3
|
# IPv6 are supported.
|
3
4
|
#
|
@@ -22,16 +23,28 @@
|
|
22
23
|
class IPAddr
|
23
24
|
include Comparable
|
24
25
|
|
26
|
+
# <!--
|
27
|
+
# rdoc-file=lib/ipaddr.rb
|
28
|
+
# - new_ntoh(addr)
|
29
|
+
# -->
|
25
30
|
# Creates a new ipaddr containing the given network byte ordered string form of
|
26
31
|
# an IP address.
|
27
32
|
#
|
28
33
|
def self.new_ntoh: (String addr) -> IPAddr
|
29
34
|
|
35
|
+
# <!--
|
36
|
+
# rdoc-file=lib/ipaddr.rb
|
37
|
+
# - ntop(addr)
|
38
|
+
# -->
|
30
39
|
# Convert a network byte ordered string form of an IP address into human
|
31
40
|
# readable form.
|
32
41
|
#
|
33
42
|
def self.ntop: (String addr) -> String
|
34
43
|
|
44
|
+
# <!--
|
45
|
+
# rdoc-file=lib/ipaddr.rb
|
46
|
+
# - new(addr = '::', family = Socket::AF_UNSPEC)
|
47
|
+
# -->
|
35
48
|
# Creates a new ipaddr object either from a human readable IP address
|
36
49
|
# representation in string, or from a packed in_addr value followed by an
|
37
50
|
# address family.
|
@@ -52,44 +65,86 @@ class IPAddr
|
|
52
65
|
#
|
53
66
|
def initialize: (?String addr, ?untyped family) -> IPAddr
|
54
67
|
|
68
|
+
# <!--
|
69
|
+
# rdoc-file=lib/ipaddr.rb
|
70
|
+
# - &(other)
|
71
|
+
# -->
|
55
72
|
# Returns a new ipaddr built by bitwise AND.
|
56
73
|
#
|
57
74
|
def &: (untyped other) -> IPAddr
|
58
75
|
|
76
|
+
# <!--
|
77
|
+
# rdoc-file=lib/ipaddr.rb
|
78
|
+
# - <<(num)
|
79
|
+
# -->
|
59
80
|
# Returns a new ipaddr built by bitwise left shift.
|
60
81
|
#
|
61
82
|
def <<: (Integer num) -> IPAddr
|
62
83
|
|
84
|
+
# <!--
|
85
|
+
# rdoc-file=lib/ipaddr.rb
|
86
|
+
# - <=>(other)
|
87
|
+
# -->
|
63
88
|
# Compares the ipaddr with another.
|
64
89
|
#
|
65
90
|
def <=>: (untyped other) -> Integer?
|
66
91
|
|
92
|
+
# <!--
|
93
|
+
# rdoc-file=lib/ipaddr.rb
|
94
|
+
# - ==(other)
|
95
|
+
# -->
|
67
96
|
# Returns true if two ipaddrs are equal.
|
68
97
|
#
|
69
98
|
def ==: (untyped other) -> bool
|
70
99
|
|
100
|
+
# <!--
|
101
|
+
# rdoc-file=lib/ipaddr.rb
|
102
|
+
# - ===(other)
|
103
|
+
# -->
|
104
|
+
#
|
71
105
|
alias === include?
|
72
106
|
|
107
|
+
# <!--
|
108
|
+
# rdoc-file=lib/ipaddr.rb
|
109
|
+
# - >>(num)
|
110
|
+
# -->
|
73
111
|
# Returns a new ipaddr built by bitwise right-shift.
|
74
112
|
#
|
75
113
|
def >>: (Integer num) -> IPAddr
|
76
114
|
|
115
|
+
# <!--
|
116
|
+
# rdoc-file=lib/ipaddr.rb
|
117
|
+
# - eql?(other)
|
118
|
+
# -->
|
77
119
|
# Checks equality used by Hash.
|
78
120
|
#
|
79
121
|
def eql?: (untyped other) -> bool
|
80
122
|
|
123
|
+
# <!-- rdoc-file=lib/ipaddr.rb -->
|
81
124
|
# Returns the address family of this IP address.
|
82
125
|
#
|
83
126
|
attr_reader family: Integer
|
84
127
|
|
128
|
+
# <!--
|
129
|
+
# rdoc-file=lib/ipaddr.rb
|
130
|
+
# - hash()
|
131
|
+
# -->
|
85
132
|
# Returns a hash value used by Hash, Set, and Array classes
|
86
133
|
#
|
87
134
|
def hash: () -> Integer
|
88
135
|
|
136
|
+
# <!--
|
137
|
+
# rdoc-file=lib/ipaddr.rb
|
138
|
+
# - hton()
|
139
|
+
# -->
|
89
140
|
# Returns a network byte ordered string form of the IP address.
|
90
141
|
#
|
91
142
|
def hton: () -> String
|
92
143
|
|
144
|
+
# <!--
|
145
|
+
# rdoc-file=lib/ipaddr.rb
|
146
|
+
# - include?(other)
|
147
|
+
# -->
|
93
148
|
# Returns true if the given ipaddr is in the range.
|
94
149
|
#
|
95
150
|
# e.g.:
|
@@ -97,79 +152,146 @@ class IPAddr
|
|
97
152
|
# net1 = IPAddr.new("192.168.2.0/24")
|
98
153
|
# net2 = IPAddr.new("192.168.2.100")
|
99
154
|
# net3 = IPAddr.new("192.168.3.0")
|
155
|
+
# net4 = IPAddr.new("192.168.2.0/16")
|
100
156
|
# p net1.include?(net2) #=> true
|
101
157
|
# p net1.include?(net3) #=> false
|
158
|
+
# p net1.include?(net4) #=> false
|
159
|
+
# p net4.include?(net1) #=> true
|
102
160
|
#
|
103
161
|
def include?: (untyped other) -> bool
|
104
162
|
|
163
|
+
# <!--
|
164
|
+
# rdoc-file=lib/ipaddr.rb
|
165
|
+
# - inspect()
|
166
|
+
# -->
|
105
167
|
# Returns a string containing a human-readable representation of the ipaddr.
|
106
168
|
# ("#<IPAddr: family:address/mask>")
|
107
169
|
#
|
108
170
|
def inspect: () -> String
|
109
171
|
|
172
|
+
# <!--
|
173
|
+
# rdoc-file=lib/ipaddr.rb
|
174
|
+
# - ip6_arpa()
|
175
|
+
# -->
|
110
176
|
# Returns a string for DNS reverse lookup compatible with RFC3172.
|
111
177
|
#
|
112
178
|
def ip6_arpa: () -> String
|
113
179
|
|
180
|
+
# <!--
|
181
|
+
# rdoc-file=lib/ipaddr.rb
|
182
|
+
# - ip6_int()
|
183
|
+
# -->
|
114
184
|
# Returns a string for DNS reverse lookup compatible with RFC1886.
|
115
185
|
#
|
116
186
|
def ip6_int: () -> String
|
117
187
|
|
188
|
+
# <!--
|
189
|
+
# rdoc-file=lib/ipaddr.rb
|
190
|
+
# - ipv4?()
|
191
|
+
# -->
|
118
192
|
# Returns true if the ipaddr is an IPv4 address.
|
119
193
|
#
|
120
194
|
def ipv4?: () -> bool
|
121
195
|
|
196
|
+
# <!--
|
197
|
+
# rdoc-file=lib/ipaddr.rb
|
198
|
+
# - ipv4_compat()
|
199
|
+
# -->
|
122
200
|
# Returns a new ipaddr built by converting the native IPv4 address into an
|
123
201
|
# IPv4-compatible IPv6 address.
|
124
202
|
#
|
125
203
|
def ipv4_compat: () -> IPAddr
|
126
204
|
|
205
|
+
# <!--
|
206
|
+
# rdoc-file=lib/ipaddr.rb
|
207
|
+
# - ipv4_compat?()
|
208
|
+
# -->
|
127
209
|
# Returns true if the ipaddr is an IPv4-compatible IPv6 address.
|
128
210
|
#
|
129
211
|
def ipv4_compat?: () -> bool
|
130
212
|
|
213
|
+
# <!--
|
214
|
+
# rdoc-file=lib/ipaddr.rb
|
215
|
+
# - ipv4_mapped()
|
216
|
+
# -->
|
131
217
|
# Returns a new ipaddr built by converting the native IPv4 address into an
|
132
218
|
# IPv4-mapped IPv6 address.
|
133
219
|
#
|
134
220
|
def ipv4_mapped: () -> IPAddr
|
135
221
|
|
222
|
+
# <!--
|
223
|
+
# rdoc-file=lib/ipaddr.rb
|
224
|
+
# - ipv4_mapped?()
|
225
|
+
# -->
|
136
226
|
# Returns true if the ipaddr is an IPv4-mapped IPv6 address.
|
137
227
|
#
|
138
228
|
def ipv4_mapped?: () -> bool
|
139
229
|
|
230
|
+
# <!--
|
231
|
+
# rdoc-file=lib/ipaddr.rb
|
232
|
+
# - ipv6?()
|
233
|
+
# -->
|
140
234
|
# Returns true if the ipaddr is an IPv6 address.
|
141
235
|
#
|
142
236
|
def ipv6?: () -> bool
|
143
237
|
|
238
|
+
# <!--
|
239
|
+
# rdoc-file=lib/ipaddr.rb
|
240
|
+
# - link_local?()
|
241
|
+
# -->
|
144
242
|
# Returns true if the ipaddr is a link-local address. IPv4 addresses in
|
145
243
|
# 169.254.0.0/16 reserved by RFC 3927 and Link-Local IPv6 Unicast Addresses in
|
146
244
|
# fe80::/10 reserved by RFC 4291 are considered link-local.
|
147
245
|
#
|
148
246
|
def link_local?: () -> bool
|
149
247
|
|
248
|
+
# <!--
|
249
|
+
# rdoc-file=lib/ipaddr.rb
|
250
|
+
# - loopback?()
|
251
|
+
# -->
|
150
252
|
# Returns true if the ipaddr is a loopback address.
|
151
253
|
#
|
152
254
|
def loopback?: () -> bool
|
153
255
|
|
256
|
+
# <!--
|
257
|
+
# rdoc-file=lib/ipaddr.rb
|
258
|
+
# - mask(prefixlen)
|
259
|
+
# -->
|
154
260
|
# Returns a new ipaddr built by masking IP address with the given
|
155
261
|
# prefixlen/netmask. (e.g. 8, 64, "255.255.255.0", etc.)
|
156
262
|
#
|
157
263
|
def mask: (String | Integer prefixlen) -> IPAddr
|
158
264
|
|
265
|
+
# <!--
|
266
|
+
# rdoc-file=lib/ipaddr.rb
|
267
|
+
# - native()
|
268
|
+
# -->
|
159
269
|
# Returns a new ipaddr built by converting the IPv6 address into a native IPv4
|
160
270
|
# address. If the IP address is not an IPv4-mapped or IPv4-compatible IPv6
|
161
271
|
# address, returns self.
|
162
272
|
#
|
163
273
|
def native: () -> IPAddr
|
164
274
|
|
275
|
+
# <!--
|
276
|
+
# rdoc-file=lib/ipaddr.rb
|
277
|
+
# - prefix()
|
278
|
+
# -->
|
165
279
|
# Returns the prefix length in bits for the ipaddr.
|
166
280
|
#
|
167
281
|
def prefix: () -> Integer
|
168
282
|
|
283
|
+
# <!--
|
284
|
+
# rdoc-file=lib/ipaddr.rb
|
285
|
+
# - prefix=(prefix)
|
286
|
+
# -->
|
169
287
|
# Sets the prefix length in bits
|
170
288
|
#
|
171
289
|
def prefix=: (Integer prefix) -> self
|
172
290
|
|
291
|
+
# <!--
|
292
|
+
# rdoc-file=lib/ipaddr.rb
|
293
|
+
# - private?()
|
294
|
+
# -->
|
173
295
|
# Returns true if the ipaddr is a private address. IPv4 addresses in
|
174
296
|
# 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16 as defined in RFC 1918 and IPv6
|
175
297
|
# Unique Local Addresses in fc00::/7 as defined in RFC 4193 are considered
|
@@ -177,51 +299,86 @@ class IPAddr
|
|
177
299
|
#
|
178
300
|
def private?: () -> bool
|
179
301
|
|
302
|
+
# <!--
|
303
|
+
# rdoc-file=lib/ipaddr.rb
|
304
|
+
# - reverse()
|
305
|
+
# -->
|
180
306
|
# Returns a string for DNS reverse lookup. It returns a string in RFC3172 form
|
181
307
|
# for an IPv6 address.
|
182
308
|
#
|
183
309
|
def reverse: () -> String
|
184
310
|
|
311
|
+
# <!--
|
312
|
+
# rdoc-file=lib/ipaddr.rb
|
313
|
+
# - succ()
|
314
|
+
# -->
|
185
315
|
# Returns the successor to the ipaddr.
|
186
316
|
#
|
187
317
|
def succ: () -> IPAddr
|
188
318
|
|
319
|
+
# <!--
|
320
|
+
# rdoc-file=lib/ipaddr.rb
|
321
|
+
# - to_i()
|
322
|
+
# -->
|
189
323
|
# Returns the integer representation of the ipaddr.
|
190
324
|
#
|
191
325
|
def to_i: () -> Integer
|
192
326
|
|
327
|
+
# <!--
|
328
|
+
# rdoc-file=lib/ipaddr.rb
|
329
|
+
# - to_range()
|
330
|
+
# -->
|
193
331
|
# Creates a Range object for the network address.
|
194
332
|
#
|
195
333
|
def to_range: () -> Range[IPAddr]
|
196
334
|
|
335
|
+
# <!--
|
336
|
+
# rdoc-file=lib/ipaddr.rb
|
337
|
+
# - to_s()
|
338
|
+
# -->
|
197
339
|
# Returns a string containing the IP address representation.
|
198
340
|
#
|
199
341
|
def to_s: () -> String
|
200
342
|
|
343
|
+
# <!--
|
344
|
+
# rdoc-file=lib/ipaddr.rb
|
345
|
+
# - to_string()
|
346
|
+
# -->
|
201
347
|
# Returns a string containing the IP address representation in canonical form.
|
202
348
|
#
|
203
349
|
def to_string: () -> String
|
204
350
|
|
351
|
+
# <!--
|
352
|
+
# rdoc-file=lib/ipaddr.rb
|
353
|
+
# - |(other)
|
354
|
+
# -->
|
205
355
|
# Returns a new ipaddr built by bitwise OR.
|
206
356
|
#
|
207
357
|
def |: (untyped other) -> IPAddr
|
208
358
|
|
359
|
+
# <!--
|
360
|
+
# rdoc-file=lib/ipaddr.rb
|
361
|
+
# - ~()
|
362
|
+
# -->
|
209
363
|
# Returns a new ipaddr built by bitwise negation.
|
210
364
|
#
|
211
365
|
def ~: () -> IPAddr
|
212
366
|
end
|
213
367
|
|
368
|
+
# <!-- rdoc-file=lib/ipaddr.rb -->
|
214
369
|
# Generic IPAddr related error. Exceptions raised in this class should inherit
|
215
370
|
# from Error.
|
216
371
|
#
|
217
372
|
class IPAddr::Error < ArgumentError
|
218
373
|
end
|
219
374
|
|
375
|
+
# <!-- rdoc-file=lib/ipaddr.rb -->
|
220
376
|
# Raised when the provided IP address is an invalid address.
|
221
377
|
#
|
222
378
|
class IPAddr::InvalidAddressError < IPAddr::Error
|
223
379
|
end
|
224
380
|
|
381
|
+
# <!-- rdoc-file=lib/ipaddr.rb -->
|
225
382
|
# Raised when the address family is invalid such as an address with an
|
226
383
|
# unsupported family, an address with an inconsistent family, or an address
|
227
384
|
# who's family cannot be determined.
|
@@ -229,19 +386,23 @@ end
|
|
229
386
|
class IPAddr::AddressFamilyError < IPAddr::Error
|
230
387
|
end
|
231
388
|
|
389
|
+
# <!-- rdoc-file=lib/ipaddr.rb -->
|
232
390
|
# Raised when the address is an invalid length.
|
233
391
|
#
|
234
392
|
class IPAddr::InvalidPrefixError < IPAddr::InvalidAddressError
|
235
393
|
end
|
236
394
|
|
395
|
+
# <!-- rdoc-file=lib/ipaddr.rb -->
|
237
396
|
# 32 bit mask for IPv4
|
238
397
|
#
|
239
398
|
IPAddr::IN4MASK: Integer
|
240
399
|
|
400
|
+
# <!-- rdoc-file=lib/ipaddr.rb -->
|
241
401
|
# Format string for IPv6
|
242
402
|
#
|
243
403
|
IPAddr::IN6FORMAT: String
|
244
404
|
|
405
|
+
# <!-- rdoc-file=lib/ipaddr.rb -->
|
245
406
|
# 128 bit mask for IPv6
|
246
407
|
#
|
247
408
|
IPAddr::IN6MASK: Integer
|