parking_ticket 1.0.47 → 1.0.49

Sign up to get free protection for your applications and to get access to all the features.
Files changed (67) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +4 -0
  3. data/.vscode/settings.json +3 -0
  4. data/Gemfile +0 -15
  5. data/Gemfile.lock +72 -4
  6. data/Rakefile +2 -2
  7. data/bin/console +3 -3
  8. data/bin/tapioca +29 -0
  9. data/lib/clients/models/payment_method.rb +15 -0
  10. data/lib/clients/models/quote.rb +16 -0
  11. data/lib/clients/models/rate_option.rb +19 -0
  12. data/lib/clients/models/structuraly_comparable.rb +14 -0
  13. data/lib/clients/models/ticket.rb +19 -0
  14. data/lib/clients/models/vehicle.rb +17 -0
  15. data/lib/clients/pay_by_phone/adapter.rb +106 -50
  16. data/lib/clients/pay_by_phone/client.rb +101 -38
  17. data/lib/parking_ticket/configuration.rb +3 -0
  18. data/lib/parking_ticket/version.rb +2 -1
  19. data/lib/parking_ticket.rb +79 -54
  20. data/sorbet/config +4 -0
  21. data/sorbet/rbi/annotations/faraday.rbi +17 -0
  22. data/sorbet/rbi/annotations/rainbow.rbi +269 -0
  23. data/sorbet/rbi/annotations/webmock.rbi +9 -0
  24. data/sorbet/rbi/gems/addressable@2.8.1.rbi +2000 -0
  25. data/sorbet/rbi/gems/amazing_print@1.4.0.rbi +872 -0
  26. data/sorbet/rbi/gems/ast@2.4.2.rbi +584 -0
  27. data/sorbet/rbi/gems/crack@0.4.5.rbi +144 -0
  28. data/sorbet/rbi/gems/diff-lcs@1.5.0.rbi +1079 -0
  29. data/sorbet/rbi/gems/faraday-net_http@3.0.2.rbi +146 -0
  30. data/sorbet/rbi/gems/faraday@2.7.2.rbi +2518 -0
  31. data/sorbet/rbi/gems/hashdiff@1.0.1.rbi +350 -0
  32. data/sorbet/rbi/gems/json@2.6.3.rbi +1541 -0
  33. data/sorbet/rbi/gems/json_matchers@0.11.1.rbi +133 -0
  34. data/sorbet/rbi/gems/json_schema@0.21.0.rbi +1165 -0
  35. data/sorbet/rbi/gems/netrc@0.11.0.rbi +161 -0
  36. data/sorbet/rbi/gems/parallel@1.22.1.rbi +277 -0
  37. data/sorbet/rbi/gems/parser@3.2.2.0.rbi +7207 -0
  38. data/sorbet/rbi/gems/public_suffix@5.0.1.rbi +940 -0
  39. data/sorbet/rbi/gems/rainbow@3.1.1.rbi +402 -0
  40. data/sorbet/rbi/gems/rake@13.0.6.rbi +2881 -0
  41. data/sorbet/rbi/gems/rbi@0.0.16.rbi +3008 -0
  42. data/sorbet/rbi/gems/regexp_parser@2.7.0.rbi +3600 -0
  43. data/sorbet/rbi/gems/rexml@3.2.5.rbi +4823 -0
  44. data/sorbet/rbi/gems/rspec-core@3.12.0.rbi +10826 -0
  45. data/sorbet/rbi/gems/rspec-expectations@3.12.1.rbi +8118 -0
  46. data/sorbet/rbi/gems/rspec-mocks@3.12.1.rbi +5300 -0
  47. data/sorbet/rbi/gems/rspec-support@3.12.0.rbi +1615 -0
  48. data/sorbet/rbi/gems/rspec@3.12.0.rbi +82 -0
  49. data/sorbet/rbi/gems/rubocop-ast@1.28.0.rbi +6985 -0
  50. data/sorbet/rbi/gems/rubocop-sorbet@0.7.0.rbi +1043 -0
  51. data/sorbet/rbi/gems/rubocop@1.48.1.rbi +54934 -0
  52. data/sorbet/rbi/gems/ruby-progressbar@1.13.0.rbi +1317 -0
  53. data/sorbet/rbi/gems/ruby2_keywords@0.0.5.rbi +8 -0
  54. data/sorbet/rbi/gems/spoom@1.2.1.rbi +2503 -0
  55. data/sorbet/rbi/gems/tapioca@0.11.4.rbi +3212 -0
  56. data/sorbet/rbi/gems/thor@1.2.1.rbi +3956 -0
  57. data/sorbet/rbi/gems/unicode-display_width@2.4.2.rbi +65 -0
  58. data/sorbet/rbi/gems/unparser@0.6.7.rbi +4515 -0
  59. data/sorbet/rbi/gems/vcr@6.1.0.rbi +3023 -0
  60. data/sorbet/rbi/gems/webmock@3.18.1.rbi +1728 -0
  61. data/sorbet/rbi/gems/webrick@1.7.0.rbi +2584 -0
  62. data/sorbet/rbi/gems/yard-sorbet@0.8.0.rbi +441 -0
  63. data/sorbet/rbi/gems/yard@0.9.28.rbi +17802 -0
  64. data/sorbet/tapioca/config.yml +13 -0
  65. data/sorbet/tapioca/require.rb +4 -0
  66. metadata +241 -4
  67. data/lib/clients/adapter.rb +0 -75
@@ -0,0 +1,2000 @@
1
+ # typed: true
2
+
3
+ # DO NOT EDIT MANUALLY
4
+ # This is an autogenerated file for types exported from the `addressable` gem.
5
+ # Please instead update this file by running `bin/tapioca gem addressable`.
6
+
7
+ # Addressable is a library for processing links and URIs.
8
+ #
9
+ # source://addressable//lib/addressable/version.rb#22
10
+ module Addressable; end
11
+
12
+ # source://addressable//lib/addressable/idna/pure.rb#21
13
+ module Addressable::IDNA
14
+ class << self
15
+ # Converts from a Unicode internationalized domain name to an ASCII
16
+ # domain name as described in RFC 3490.
17
+ #
18
+ # source://addressable//lib/addressable/idna/pure.rb#67
19
+ def to_ascii(input); end
20
+
21
+ # Converts from an ASCII domain name to a Unicode internationalized
22
+ # domain name as described in RFC 3490.
23
+ #
24
+ # source://addressable//lib/addressable/idna/pure.rb#93
25
+ def to_unicode(input); end
26
+
27
+ # Unicode normalization form KC.
28
+ #
29
+ # source://addressable//lib/addressable/idna/pure.rb#116
30
+ def unicode_normalize_kc(input); end
31
+
32
+ private
33
+
34
+ # source://addressable//lib/addressable/idna/pure.rb#282
35
+ def lookup_unicode_combining_class(codepoint); end
36
+
37
+ # source://addressable//lib/addressable/idna/pure.rb#290
38
+ def lookup_unicode_compatibility(codepoint); end
39
+
40
+ # source://addressable//lib/addressable/idna/pure.rb#305
41
+ def lookup_unicode_composition(unpacked); end
42
+
43
+ # source://addressable//lib/addressable/idna/pure.rb#297
44
+ def lookup_unicode_lowercase(codepoint); end
45
+
46
+ # Bias adaptation method
47
+ #
48
+ # source://addressable//lib/addressable/idna/pure.rb#660
49
+ def punycode_adapt(delta, numpoints, firsttime); end
50
+
51
+ # @return [Boolean]
52
+ #
53
+ # source://addressable//lib/addressable/idna/pure.rb#628
54
+ def punycode_basic?(codepoint); end
55
+
56
+ # source://addressable//lib/addressable/idna/pure.rb#506
57
+ def punycode_decode(punycode); end
58
+
59
+ # Returns the numeric value of a basic codepoint
60
+ # (for use in representing integers) in the range 0 to
61
+ # base - 1, or PUNYCODE_BASE if codepoint does not represent a value.
62
+ #
63
+ # source://addressable//lib/addressable/idna/pure.rb#646
64
+ def punycode_decode_digit(codepoint); end
65
+
66
+ # @return [Boolean]
67
+ #
68
+ # source://addressable//lib/addressable/idna/pure.rb#633
69
+ def punycode_delimiter?(codepoint); end
70
+
71
+ # source://addressable//lib/addressable/idna/pure.rb#385
72
+ def punycode_encode(unicode); end
73
+
74
+ # source://addressable//lib/addressable/idna/pure.rb#638
75
+ def punycode_encode_digit(d); end
76
+
77
+ # source://addressable//lib/addressable/idna/pure.rb#188
78
+ def ucs4_to_utf8(char, buffer); end
79
+
80
+ # source://addressable//lib/addressable/idna/pure.rb#139
81
+ def unicode_compose(unpacked); end
82
+
83
+ # source://addressable//lib/addressable/idna/pure.rb#164
84
+ def unicode_compose_pair(ch_one, ch_two); end
85
+
86
+ # source://addressable//lib/addressable/idna/pure.rb#244
87
+ def unicode_decompose(unpacked); end
88
+
89
+ # source://addressable//lib/addressable/idna/pure.rb#265
90
+ def unicode_decompose_hangul(codepoint); end
91
+
92
+ # Unicode aware downcase method.
93
+ #
94
+ # @api private
95
+ # @param input [String] The input string.
96
+ # @return [String] The downcased result.
97
+ #
98
+ # source://addressable//lib/addressable/idna/pure.rb#131
99
+ def unicode_downcase(input); end
100
+
101
+ # source://addressable//lib/addressable/idna/pure.rb#220
102
+ def unicode_sort_canonical(unpacked); end
103
+ end
104
+ end
105
+
106
+ # source://addressable//lib/addressable/idna/pure.rb#355
107
+ Addressable::IDNA::ACE_MAX_LENGTH = T.let(T.unsafe(nil), Integer)
108
+
109
+ # source://addressable//lib/addressable/idna/pure.rb#40
110
+ Addressable::IDNA::ACE_PREFIX = T.let(T.unsafe(nil), String)
111
+
112
+ # source://addressable//lib/addressable/idna/pure.rb#344
113
+ Addressable::IDNA::COMPOSITION_TABLE = T.let(T.unsafe(nil), Hash)
114
+
115
+ # source://addressable//lib/addressable/idna/pure.rb#311
116
+ Addressable::IDNA::HANGUL_LBASE = T.let(T.unsafe(nil), Integer)
117
+
118
+ # source://addressable//lib/addressable/idna/pure.rb#312
119
+ Addressable::IDNA::HANGUL_LCOUNT = T.let(T.unsafe(nil), Integer)
120
+
121
+ # 588
122
+ #
123
+ # source://addressable//lib/addressable/idna/pure.rb#317
124
+ Addressable::IDNA::HANGUL_NCOUNT = T.let(T.unsafe(nil), Integer)
125
+
126
+ # source://addressable//lib/addressable/idna/pure.rb#310
127
+ Addressable::IDNA::HANGUL_SBASE = T.let(T.unsafe(nil), Integer)
128
+
129
+ # 11172
130
+ #
131
+ # source://addressable//lib/addressable/idna/pure.rb#318
132
+ Addressable::IDNA::HANGUL_SCOUNT = T.let(T.unsafe(nil), Integer)
133
+
134
+ # source://addressable//lib/addressable/idna/pure.rb#315
135
+ Addressable::IDNA::HANGUL_TBASE = T.let(T.unsafe(nil), Integer)
136
+
137
+ # source://addressable//lib/addressable/idna/pure.rb#316
138
+ Addressable::IDNA::HANGUL_TCOUNT = T.let(T.unsafe(nil), Integer)
139
+
140
+ # source://addressable//lib/addressable/idna/pure.rb#313
141
+ Addressable::IDNA::HANGUL_VBASE = T.let(T.unsafe(nil), Integer)
142
+
143
+ # source://addressable//lib/addressable/idna/pure.rb#314
144
+ Addressable::IDNA::HANGUL_VCOUNT = T.let(T.unsafe(nil), Integer)
145
+
146
+ # source://addressable//lib/addressable/idna/pure.rb#357
147
+ Addressable::IDNA::PUNYCODE_BASE = T.let(T.unsafe(nil), Integer)
148
+
149
+ # source://addressable//lib/addressable/idna/pure.rb#361
150
+ Addressable::IDNA::PUNYCODE_DAMP = T.let(T.unsafe(nil), Integer)
151
+
152
+ # source://addressable//lib/addressable/idna/pure.rb#364
153
+ Addressable::IDNA::PUNYCODE_DELIMITER = T.let(T.unsafe(nil), Integer)
154
+
155
+ # source://addressable//lib/addressable/idna/pure.rb#362
156
+ Addressable::IDNA::PUNYCODE_INITIAL_BIAS = T.let(T.unsafe(nil), Integer)
157
+
158
+ # source://addressable//lib/addressable/idna/pure.rb#363
159
+ Addressable::IDNA::PUNYCODE_INITIAL_N = T.let(T.unsafe(nil), Integer)
160
+
161
+ # source://addressable//lib/addressable/idna/pure.rb#366
162
+ Addressable::IDNA::PUNYCODE_MAXINT = T.let(T.unsafe(nil), Integer)
163
+
164
+ # source://addressable//lib/addressable/idna/pure.rb#368
165
+ Addressable::IDNA::PUNYCODE_PRINT_ASCII = T.let(T.unsafe(nil), String)
166
+
167
+ # source://addressable//lib/addressable/idna/pure.rb#360
168
+ Addressable::IDNA::PUNYCODE_SKEW = T.let(T.unsafe(nil), Integer)
169
+
170
+ # source://addressable//lib/addressable/idna/pure.rb#359
171
+ Addressable::IDNA::PUNYCODE_TMAX = T.let(T.unsafe(nil), Integer)
172
+
173
+ # source://addressable//lib/addressable/idna/pure.rb#358
174
+ Addressable::IDNA::PUNYCODE_TMIN = T.let(T.unsafe(nil), Integer)
175
+
176
+ # Input is invalid.
177
+ #
178
+ # source://addressable//lib/addressable/idna/pure.rb#379
179
+ class Addressable::IDNA::PunycodeBadInput < ::StandardError; end
180
+
181
+ # Output would exceed the space provided.
182
+ #
183
+ # source://addressable//lib/addressable/idna/pure.rb#381
184
+ class Addressable::IDNA::PunycodeBigOutput < ::StandardError; end
185
+
186
+ # Input needs wider integers to process.
187
+ #
188
+ # source://addressable//lib/addressable/idna/pure.rb#383
189
+ class Addressable::IDNA::PunycodeOverflow < ::StandardError; end
190
+
191
+ # source://addressable//lib/addressable/idna/pure.rb#335
192
+ Addressable::IDNA::UNICODE_DATA = T.let(T.unsafe(nil), Hash)
193
+
194
+ # source://addressable//lib/addressable/idna/pure.rb#322
195
+ Addressable::IDNA::UNICODE_DATA_CANONICAL = T.let(T.unsafe(nil), Integer)
196
+
197
+ # source://addressable//lib/addressable/idna/pure.rb#320
198
+ Addressable::IDNA::UNICODE_DATA_COMBINING_CLASS = T.let(T.unsafe(nil), Integer)
199
+
200
+ # source://addressable//lib/addressable/idna/pure.rb#323
201
+ Addressable::IDNA::UNICODE_DATA_COMPATIBILITY = T.let(T.unsafe(nil), Integer)
202
+
203
+ # source://addressable//lib/addressable/idna/pure.rb#321
204
+ Addressable::IDNA::UNICODE_DATA_EXCLUSION = T.let(T.unsafe(nil), Integer)
205
+
206
+ # source://addressable//lib/addressable/idna/pure.rb#325
207
+ Addressable::IDNA::UNICODE_DATA_LOWERCASE = T.let(T.unsafe(nil), Integer)
208
+
209
+ # source://addressable//lib/addressable/idna/pure.rb#326
210
+ Addressable::IDNA::UNICODE_DATA_TITLECASE = T.let(T.unsafe(nil), Integer)
211
+
212
+ # source://addressable//lib/addressable/idna/pure.rb#324
213
+ Addressable::IDNA::UNICODE_DATA_UPPERCASE = T.let(T.unsafe(nil), Integer)
214
+
215
+ # source://addressable//lib/addressable/idna/pure.rb#354
216
+ Addressable::IDNA::UNICODE_MAX_LENGTH = T.let(T.unsafe(nil), Integer)
217
+
218
+ # source://addressable//lib/addressable/idna/pure.rb#36
219
+ Addressable::IDNA::UNICODE_TABLE = T.let(T.unsafe(nil), String)
220
+
221
+ # source://addressable//lib/addressable/idna/pure.rb#42
222
+ Addressable::IDNA::UTF8_REGEX = T.let(T.unsafe(nil), Regexp)
223
+
224
+ # source://addressable//lib/addressable/idna/pure.rb#53
225
+ Addressable::IDNA::UTF8_REGEX_MULTIBYTE = T.let(T.unsafe(nil), Regexp)
226
+
227
+ # This is an implementation of a URI template based on
228
+ # RFC 6570 (http://tools.ietf.org/html/rfc6570).
229
+ #
230
+ # source://addressable//lib/addressable/template.rb#27
231
+ class Addressable::Template
232
+ # Creates a new <tt>Addressable::Template</tt> object.
233
+ #
234
+ # @param pattern [#to_str] The URI Template pattern.
235
+ # @return [Addressable::Template] The initialized Template object.
236
+ #
237
+ # source://addressable//lib/addressable/template.rb#234
238
+ def initialize(pattern); end
239
+
240
+ # Returns <code>true</code> if the Template objects are equal. This method
241
+ # does NOT normalize either Template before doing the comparison.
242
+ #
243
+ # @param template [Object] The Template to compare.
244
+ # @return [TrueClass, FalseClass] <code>true</code> if the Templates are equivalent, <code>false</code>
245
+ # otherwise.
246
+ #
247
+ # source://addressable//lib/addressable/template.rb#274
248
+ def ==(template); end
249
+
250
+ # Returns <code>true</code> if the Template objects are equal. This method
251
+ # does NOT normalize either Template before doing the comparison.
252
+ # Addressable::Template makes no distinction between `==` and `eql?`.
253
+ #
254
+ # @param template [Object] The Template to compare.
255
+ # @return [TrueClass, FalseClass] <code>true</code> if the Templates are equivalent, <code>false</code>
256
+ # otherwise.
257
+ # @see #==
258
+ #
259
+ # source://addressable//lib/addressable/template.rb#274
260
+ def eql?(template); end
261
+
262
+ # Expands a URI template into a full URI.
263
+ #
264
+ # The object should respond to either the <tt>validate</tt> or
265
+ # <tt>transform</tt> messages or both. Both the <tt>validate</tt> and
266
+ # <tt>transform</tt> methods should take two parameters: <tt>name</tt> and
267
+ # <tt>value</tt>. The <tt>validate</tt> method should return <tt>true</tt>
268
+ # or <tt>false</tt>; <tt>true</tt> if the value of the variable is valid,
269
+ # <tt>false</tt> otherwise. An <tt>InvalidTemplateValueError</tt>
270
+ # exception will be raised if the value is invalid. The <tt>transform</tt>
271
+ # method should return the transformed variable value as a <tt>String</tt>.
272
+ # If a <tt>transform</tt> method is used, the value will not be percent
273
+ # encoded automatically. Unicode normalization will be performed both
274
+ # before and after sending the value to the transform method.
275
+ #
276
+ # @example
277
+ # class ExampleProcessor
278
+ # def self.validate(name, value)
279
+ # return !!(value =~ /^[\w ]+$/) if name == "query"
280
+ # return true
281
+ # end
282
+ #
283
+ # def self.transform(name, value)
284
+ # return value.gsub(/ /, "+") if name == "query"
285
+ # return value
286
+ # end
287
+ # end
288
+ #
289
+ # Addressable::Template.new(
290
+ # "http://example.com/search/{query}/"
291
+ # ).expand(
292
+ # {"query" => "an example search query"},
293
+ # ExampleProcessor
294
+ # ).to_str
295
+ # #=> "http://example.com/search/an+example+search+query/"
296
+ #
297
+ # Addressable::Template.new(
298
+ # "http://example.com/search/{query}/"
299
+ # ).expand(
300
+ # {"query" => "an example search query"}
301
+ # ).to_str
302
+ # #=> "http://example.com/search/an%20example%20search%20query/"
303
+ #
304
+ # Addressable::Template.new(
305
+ # "http://example.com/search/{query}/"
306
+ # ).expand(
307
+ # {"query" => "bogus!"},
308
+ # ExampleProcessor
309
+ # ).to_str
310
+ # #=> Addressable::Template::InvalidTemplateValueError
311
+ # @param mapping [Hash] The mapping that corresponds to the pattern.
312
+ # @param processor [#validate, #transform] An optional processor object may be supplied.
313
+ # @param normalize_values [Boolean] Optional flag to enable/disable unicode normalization. Default: true
314
+ # @return [Addressable::URI] The expanded URI template.
315
+ #
316
+ # source://addressable//lib/addressable/template.rb#591
317
+ def expand(mapping, processor = T.unsafe(nil), normalize_values = T.unsafe(nil)); end
318
+
319
+ # Extracts a mapping from the URI using a URI Template pattern.
320
+ #
321
+ # @example
322
+ # class ExampleProcessor
323
+ # def self.restore(name, value)
324
+ # return value.gsub(/\+/, " ") if name == "query"
325
+ # return value
326
+ # end
327
+ #
328
+ # def self.match(name)
329
+ # return ".*?" if name == "first"
330
+ # return ".*"
331
+ # end
332
+ # end
333
+ #
334
+ # uri = Addressable::URI.parse(
335
+ # "http://example.com/search/an+example+search+query/"
336
+ # )
337
+ # Addressable::Template.new(
338
+ # "http://example.com/search/{query}/"
339
+ # ).extract(uri, ExampleProcessor)
340
+ # #=> {"query" => "an example search query"}
341
+ #
342
+ # uri = Addressable::URI.parse("http://example.com/a/b/c/")
343
+ # Addressable::Template.new(
344
+ # "http://example.com/{first}/{second}/"
345
+ # ).extract(uri, ExampleProcessor)
346
+ # #=> {"first" => "a", "second" => "b/c"}
347
+ #
348
+ # uri = Addressable::URI.parse("http://example.com/a/b/c/")
349
+ # Addressable::Template.new(
350
+ # "http://example.com/{first}/{-list|/|second}/"
351
+ # ).extract(uri)
352
+ # #=> {"first" => "a", "second" => ["b", "c"]}
353
+ # @param uri [Addressable::URI, #to_str] The URI to extract from.
354
+ # @param processor [#restore, #match] A template processor object may optionally be supplied.
355
+ #
356
+ # The object should respond to either the <tt>restore</tt> or
357
+ # <tt>match</tt> messages or both. The <tt>restore</tt> method should
358
+ # take two parameters: `[String] name` and `[String] value`.
359
+ # The <tt>restore</tt> method should reverse any transformations that
360
+ # have been performed on the value to ensure a valid URI.
361
+ # The <tt>match</tt> method should take a single
362
+ # parameter: `[String] name`. The <tt>match</tt> method should return
363
+ # a <tt>String</tt> containing a regular expression capture group for
364
+ # matching on that particular variable. The default value is `".*?"`.
365
+ # The <tt>match</tt> method has no effect on multivariate operator
366
+ # expansions.
367
+ # @return [Hash, NilClass] The <tt>Hash</tt> mapping that was extracted from the URI, or
368
+ # <tt>nil</tt> if the URI didn't match the template.
369
+ #
370
+ # source://addressable//lib/addressable/template.rb#342
371
+ def extract(uri, processor = T.unsafe(nil)); end
372
+
373
+ # Freeze URI, initializing instance variables.
374
+ #
375
+ # @return [Addressable::URI] The frozen URI object.
376
+ #
377
+ # source://addressable//lib/addressable/template.rb#245
378
+ def freeze; end
379
+
380
+ # Returns a <tt>String</tt> representation of the Template object's state.
381
+ #
382
+ # @return [String] The Template object's state, as a <tt>String</tt>.
383
+ #
384
+ # source://addressable//lib/addressable/template.rb#260
385
+ def inspect; end
386
+
387
+ # Returns an Array of variables used within the template pattern.
388
+ # The variables are listed in the Array in the order they appear within
389
+ # the pattern. Multiple occurrences of a variable within a pattern are
390
+ # not represented in this Array.
391
+ #
392
+ # @return [Array] The variables present in the template's pattern.
393
+ #
394
+ # source://addressable//lib/addressable/template.rb#607
395
+ def keys; end
396
+
397
+ # Extracts match data from the URI using a URI Template pattern.
398
+ #
399
+ # @example
400
+ # class ExampleProcessor
401
+ # def self.restore(name, value)
402
+ # return value.gsub(/\+/, " ") if name == "query"
403
+ # return value
404
+ # end
405
+ #
406
+ # def self.match(name)
407
+ # return ".*?" if name == "first"
408
+ # return ".*"
409
+ # end
410
+ # end
411
+ #
412
+ # uri = Addressable::URI.parse(
413
+ # "http://example.com/search/an+example+search+query/"
414
+ # )
415
+ # match = Addressable::Template.new(
416
+ # "http://example.com/search/{query}/"
417
+ # ).match(uri, ExampleProcessor)
418
+ # match.variables
419
+ # #=> ["query"]
420
+ # match.captures
421
+ # #=> ["an example search query"]
422
+ #
423
+ # uri = Addressable::URI.parse("http://example.com/a/b/c/")
424
+ # match = Addressable::Template.new(
425
+ # "http://example.com/{first}/{+second}/"
426
+ # ).match(uri, ExampleProcessor)
427
+ # match.variables
428
+ # #=> ["first", "second"]
429
+ # match.captures
430
+ # #=> ["a", "b/c"]
431
+ #
432
+ # uri = Addressable::URI.parse("http://example.com/a/b/c/")
433
+ # match = Addressable::Template.new(
434
+ # "http://example.com/{first}{/second*}/"
435
+ # ).match(uri)
436
+ # match.variables
437
+ # #=> ["first", "second"]
438
+ # match.captures
439
+ # #=> ["a", ["b", "c"]]
440
+ # @param uri [Addressable::URI, #to_str] The URI to extract from.
441
+ # @param processor [#restore, #match] A template processor object may optionally be supplied.
442
+ #
443
+ # The object should respond to either the <tt>restore</tt> or
444
+ # <tt>match</tt> messages or both. The <tt>restore</tt> method should
445
+ # take two parameters: `[String] name` and `[String] value`.
446
+ # The <tt>restore</tt> method should reverse any transformations that
447
+ # have been performed on the value to ensure a valid URI.
448
+ # The <tt>match</tt> method should take a single
449
+ # parameter: `[String] name`. The <tt>match</tt> method should return
450
+ # a <tt>String</tt> containing a regular expression capture group for
451
+ # matching on that particular variable. The default value is `".*?"`.
452
+ # The <tt>match</tt> method has no effect on multivariate operator
453
+ # expansions.
454
+ # @return [Hash, NilClass] The <tt>Hash</tt> mapping that was extracted from the URI, or
455
+ # <tt>nil</tt> if the URI didn't match the template.
456
+ #
457
+ # source://addressable//lib/addressable/template.rb#413
458
+ def match(uri, processor = T.unsafe(nil)); end
459
+
460
+ # Returns the named captures of the coerced `Regexp`.
461
+ #
462
+ # @api private
463
+ # @return [Hash] The named captures of the `Regexp` given by {#to_regexp}.
464
+ #
465
+ # source://addressable//lib/addressable/template.rb#651
466
+ def named_captures; end
467
+
468
+ # Returns an Array of variables used within the template pattern.
469
+ # The variables are listed in the Array in the order they appear within
470
+ # the pattern. Multiple occurrences of a variable within a pattern are
471
+ # not represented in this Array.
472
+ #
473
+ # @return [Array] The variables present in the template's pattern.
474
+ #
475
+ # source://addressable//lib/addressable/template.rb#607
476
+ def names; end
477
+
478
+ # Expands a URI template into another URI template.
479
+ #
480
+ # The object should respond to either the <tt>validate</tt> or
481
+ # <tt>transform</tt> messages or both. Both the <tt>validate</tt> and
482
+ # <tt>transform</tt> methods should take two parameters: <tt>name</tt> and
483
+ # <tt>value</tt>. The <tt>validate</tt> method should return <tt>true</tt>
484
+ # or <tt>false</tt>; <tt>true</tt> if the value of the variable is valid,
485
+ # <tt>false</tt> otherwise. An <tt>InvalidTemplateValueError</tt>
486
+ # exception will be raised if the value is invalid. The <tt>transform</tt>
487
+ # method should return the transformed variable value as a <tt>String</tt>.
488
+ # If a <tt>transform</tt> method is used, the value will not be percent
489
+ # encoded automatically. Unicode normalization will be performed both
490
+ # before and after sending the value to the transform method.
491
+ #
492
+ # @example
493
+ # Addressable::Template.new(
494
+ # "http://example.com/{one}/{two}/"
495
+ # ).partial_expand({"one" => "1"}).pattern
496
+ # #=> "http://example.com/1/{two}/"
497
+ #
498
+ # Addressable::Template.new(
499
+ # "http://example.com/{?one,two}/"
500
+ # ).partial_expand({"one" => "1"}).pattern
501
+ # #=> "http://example.com/?one=1{&two}/"
502
+ #
503
+ # Addressable::Template.new(
504
+ # "http://example.com/{?one,two,three}/"
505
+ # ).partial_expand({"one" => "1", "three" => 3}).pattern
506
+ # #=> "http://example.com/?one=1{&two}&three=3"
507
+ # @param mapping [Hash] The mapping that corresponds to the pattern.
508
+ # @param processor [#validate, #transform] An optional processor object may be supplied.
509
+ # @param normalize_values [Boolean] Optional flag to enable/disable unicode normalization. Default: true
510
+ # @return [Addressable::Template] The partially expanded URI template.
511
+ #
512
+ # source://addressable//lib/addressable/template.rb#524
513
+ def partial_expand(mapping, processor = T.unsafe(nil), normalize_values = T.unsafe(nil)); end
514
+
515
+ # @return [String] The Template object's pattern.
516
+ #
517
+ # source://addressable//lib/addressable/template.rb#254
518
+ def pattern; end
519
+
520
+ # Returns the source of the coerced `Regexp`.
521
+ #
522
+ # @api private
523
+ # @return [String] The source of the `Regexp` given by {#to_regexp}.
524
+ #
525
+ # source://addressable//lib/addressable/template.rb#641
526
+ def source; end
527
+
528
+ # Coerces a template into a `Regexp` object. This regular expression will
529
+ # behave very similarly to the actual template, and should match the same
530
+ # URI values, but it cannot fully handle, for example, values that would
531
+ # extract to an `Array`.
532
+ #
533
+ # @return [Regexp] A regular expression which should match the template.
534
+ #
535
+ # source://addressable//lib/addressable/template.rb#630
536
+ def to_regexp; end
537
+
538
+ # Returns a mapping of variables to their default values specified
539
+ # in the template. Variables without defaults are not returned.
540
+ #
541
+ # @return [Hash] Mapping of template variables to their defaults
542
+ #
543
+ # source://addressable//lib/addressable/template.rb#618
544
+ def variable_defaults; end
545
+
546
+ # Returns an Array of variables used within the template pattern.
547
+ # The variables are listed in the Array in the order they appear within
548
+ # the pattern. Multiple occurrences of a variable within a pattern are
549
+ # not represented in this Array.
550
+ #
551
+ # @return [Array] The variables present in the template's pattern.
552
+ #
553
+ # source://addressable//lib/addressable/template.rb#607
554
+ def variables; end
555
+
556
+ private
557
+
558
+ # Takes a set of values, and joins them together based on the
559
+ # operator.
560
+ #
561
+ # @param operator [String, Nil] One of the operators from the set
562
+ # (?,&,+,#,;,/,.), or nil if there wasn't one.
563
+ # @param return_value [Array] The set of return values (as [variable_name, value] tuples) that will
564
+ # be joined together.
565
+ # @return [String] The transformed mapped value
566
+ #
567
+ # source://addressable//lib/addressable/template.rb#861
568
+ def join_values(operator, return_value); end
569
+
570
+ # Generates a hash with string keys
571
+ #
572
+ # @param mapping [Hash] A mapping hash to normalize
573
+ # @return [Hash] A hash with stringified keys
574
+ #
575
+ # source://addressable//lib/addressable/template.rb#925
576
+ def normalize_keys(mapping); end
577
+
578
+ # Takes a set of values, and joins them together based on the
579
+ # operator.
580
+ #
581
+ # @param value [Hash, Array, String] Normalizes keys and values with IDNA#unicode_normalize_kc
582
+ # @return [Hash, Array, String] The normalized values
583
+ #
584
+ # source://addressable//lib/addressable/template.rb#898
585
+ def normalize_value(value); end
586
+
587
+ # source://addressable//lib/addressable/template.rb#656
588
+ def ordered_variable_defaults; end
589
+
590
+ # Generates the <tt>Regexp</tt> that parses a template pattern.
591
+ #
592
+ # @param pattern [String] The URI template pattern.
593
+ # @param processor [#match] The template processor to use.
594
+ # @return [Array, Regexp] An array of expansion variables nad a regular expression which may be
595
+ # used to parse a template pattern
596
+ #
597
+ # source://addressable//lib/addressable/template.rb#969
598
+ def parse_new_template_pattern(pattern, processor = T.unsafe(nil)); end
599
+
600
+ # Generates the <tt>Regexp</tt> that parses a template pattern. Memoizes the
601
+ # value if template processor not set (processors may not be deterministic)
602
+ #
603
+ # @param pattern [String] The URI template pattern.
604
+ # @param processor [#match] The template processor to use.
605
+ # @return [Array, Regexp] An array of expansion variables nad a regular expression which may be
606
+ # used to parse a template pattern
607
+ #
608
+ # source://addressable//lib/addressable/template.rb#951
609
+ def parse_template_pattern(pattern, processor = T.unsafe(nil)); end
610
+
611
+ # Transforms a mapped value so that values can be substituted into the
612
+ # template.
613
+ #
614
+ # The object should respond to either the <tt>validate</tt> or
615
+ # <tt>transform</tt> messages or both. Both the <tt>validate</tt> and
616
+ # <tt>transform</tt> methods should take two parameters: <tt>name</tt> and
617
+ # <tt>value</tt>. The <tt>validate</tt> method should return <tt>true</tt>
618
+ # or <tt>false</tt>; <tt>true</tt> if the value of the variable is valid,
619
+ # <tt>false</tt> otherwise. An <tt>InvalidTemplateValueError</tt> exception
620
+ # will be raised if the value is invalid. The <tt>transform</tt> method
621
+ # should return the transformed variable value as a <tt>String</tt>. If a
622
+ # <tt>transform</tt> method is used, the value will not be percent encoded
623
+ # automatically. Unicode normalization will be performed both before and
624
+ # after sending the value to the transform method.
625
+ #
626
+ # @param mapping [Hash] The mapping to replace captures
627
+ # @param capture [String] The expression to replace
628
+ # @param processor [#validate, #transform] An optional processor object may be supplied.
629
+ # @param normalize_values [Boolean] Optional flag to enable/disable unicode normalization. Default: true
630
+ # @return [String] The expanded expression
631
+ #
632
+ # source://addressable//lib/addressable/template.rb#753
633
+ def transform_capture(mapping, capture, processor = T.unsafe(nil), normalize_values = T.unsafe(nil)); end
634
+
635
+ # Loops through each capture and expands any values available in mapping
636
+ #
637
+ # The object should respond to either the <tt>validate</tt> or
638
+ # <tt>transform</tt> messages or both. Both the <tt>validate</tt> and
639
+ # <tt>transform</tt> methods should take two parameters: <tt>name</tt> and
640
+ # <tt>value</tt>. The <tt>validate</tt> method should return <tt>true</tt>
641
+ # or <tt>false</tt>; <tt>true</tt> if the value of the variable is valid,
642
+ # <tt>false</tt> otherwise. An <tt>InvalidTemplateValueError</tt> exception
643
+ # will be raised if the value is invalid. The <tt>transform</tt> method
644
+ # should return the transformed variable value as a <tt>String</tt>. If a
645
+ # <tt>transform</tt> method is used, the value will not be percent encoded
646
+ # automatically. Unicode normalization will be performed both before and
647
+ # after sending the value to the transform method.
648
+ #
649
+ # @param mapping [Hash] Set of keys to expand
650
+ # @param capture [String] The expression to expand
651
+ # @param processor [#validate, #transform] An optional processor object may be supplied.
652
+ # @param normalize_values [Boolean] Optional flag to enable/disable unicode normalization. Default: true
653
+ # @return [String] The expanded expression
654
+ #
655
+ # source://addressable//lib/addressable/template.rb#694
656
+ def transform_partial_capture(mapping, capture, processor = T.unsafe(nil), normalize_values = T.unsafe(nil)); end
657
+ end
658
+
659
+ # source://addressable//lib/addressable/template.rb#58
660
+ Addressable::Template::EXPRESSION = T.let(T.unsafe(nil), Regexp)
661
+
662
+ # Raised if an invalid template operator is used in a pattern.
663
+ #
664
+ # source://addressable//lib/addressable/template.rb#85
665
+ class Addressable::Template::InvalidTemplateOperatorError < ::StandardError; end
666
+
667
+ # Raised if an invalid template value is supplied.
668
+ #
669
+ # source://addressable//lib/addressable/template.rb#80
670
+ class Addressable::Template::InvalidTemplateValueError < ::StandardError; end
671
+
672
+ # source://addressable//lib/addressable/template.rb#70
673
+ Addressable::Template::JOINERS = T.let(T.unsafe(nil), Hash)
674
+
675
+ # source://addressable//lib/addressable/template.rb#62
676
+ Addressable::Template::LEADERS = T.let(T.unsafe(nil), Hash)
677
+
678
+ # This class represents the data that is extracted when a Template
679
+ # is matched against a URI.
680
+ #
681
+ # source://addressable//lib/addressable/template.rb#96
682
+ class Addressable::Template::MatchData
683
+ # Creates a new MatchData object.
684
+ # MatchData objects should never be instantiated directly.
685
+ #
686
+ # @param uri [Addressable::URI] The URI that the template was matched against.
687
+ # @return [MatchData] a new instance of MatchData
688
+ #
689
+ # source://addressable//lib/addressable/template.rb#103
690
+ def initialize(uri, template, mapping); end
691
+
692
+ # Accesses captured values by name or by index.
693
+ #
694
+ # @param key [String, Symbol, Fixnum] Capture index or name. Note that when accessing by with index
695
+ # of 0, the full URI will be returned. The intention is to mimic
696
+ # the ::MatchData#[] behavior.
697
+ # @param len [#to_int, nil] If provided, an array of values will be returend with the given
698
+ # parameter used as length.
699
+ # @return [Array, String, nil] The captured value corresponding to the index or name. If the
700
+ # value was not provided or the key is unknown, nil will be
701
+ # returned.
702
+ #
703
+ # If the second parameter is provided, an array of that length will
704
+ # be returned instead.
705
+ #
706
+ # source://addressable//lib/addressable/template.rb#170
707
+ def [](key, len = T.unsafe(nil)); end
708
+
709
+ # @return [Array] The list of values that were captured by the Template.
710
+ # Note that this list will include nils for any variables which
711
+ # were in the Template, but did not appear in the URI.
712
+ #
713
+ # source://addressable//lib/addressable/template.rb#143
714
+ def captures; end
715
+
716
+ # Returns a <tt>String</tt> representation of the MatchData's state.
717
+ #
718
+ # @return [String] The MatchData's state, as a <tt>String</tt>.
719
+ #
720
+ # source://addressable//lib/addressable/template.rb#213
721
+ def inspect; end
722
+
723
+ # @return [Array] The list of variables that were present in the Template.
724
+ # Note that this list will include variables which do not appear
725
+ # in the mapping because they were not present in URI.
726
+ #
727
+ # source://addressable//lib/addressable/template.rb#132
728
+ def keys; end
729
+
730
+ # @return [Hash] The mapping that resulted from the match.
731
+ # Note that this mapping does not include keys or values for
732
+ # variables that appear in the Template, but are not present
733
+ # in the URI.
734
+ #
735
+ # source://addressable//lib/addressable/template.rb#125
736
+ def mapping; end
737
+
738
+ # @return [Array] The list of variables that were present in the Template.
739
+ # Note that this list will include variables which do not appear
740
+ # in the mapping because they were not present in URI.
741
+ #
742
+ # source://addressable//lib/addressable/template.rb#132
743
+ def names; end
744
+
745
+ # Dummy method for code expecting a ::MatchData instance
746
+ #
747
+ # @return [String] An empty string.
748
+ #
749
+ # source://addressable//lib/addressable/template.rb#222
750
+ def post_match; end
751
+
752
+ # Dummy method for code expecting a ::MatchData instance
753
+ #
754
+ # @return [String] An empty string.
755
+ #
756
+ # source://addressable//lib/addressable/template.rb#222
757
+ def pre_match; end
758
+
759
+ # @return [String] The matched URI as String.
760
+ #
761
+ # source://addressable//lib/addressable/template.rb#191
762
+ def string; end
763
+
764
+ # @return [Addressable::Template] The Template used for the match.
765
+ #
766
+ # source://addressable//lib/addressable/template.rb#117
767
+ def template; end
768
+
769
+ # @return [Array] Array with the matched URI as first element followed by the captured
770
+ # values.
771
+ #
772
+ # source://addressable//lib/addressable/template.rb#184
773
+ def to_a; end
774
+
775
+ # @return [String] The matched URI as String.
776
+ #
777
+ # source://addressable//lib/addressable/template.rb#191
778
+ def to_s; end
779
+
780
+ # @return [Addressable::URI] The URI that the Template was matched against.
781
+ #
782
+ # source://addressable//lib/addressable/template.rb#112
783
+ def uri; end
784
+
785
+ # @return [Array] The list of values that were captured by the Template.
786
+ # Note that this list will include nils for any variables which
787
+ # were in the Template, but did not appear in the URI.
788
+ #
789
+ # source://addressable//lib/addressable/template.rb#143
790
+ def values; end
791
+
792
+ # Returns multiple captured values at once.
793
+ #
794
+ # @param *indexes [String, Symbol, Fixnum] Indices of the captures to be returned
795
+ # @return [Array] Values corresponding to given indices.
796
+ # @see Addressable::Template::MatchData#[]
797
+ #
798
+ # source://addressable//lib/addressable/template.rb#205
799
+ def values_at(*indexes); end
800
+
801
+ # @return [Array] The list of variables that were present in the Template.
802
+ # Note that this list will include variables which do not appear
803
+ # in the mapping because they were not present in URI.
804
+ #
805
+ # source://addressable//lib/addressable/template.rb#132
806
+ def variables; end
807
+ end
808
+
809
+ # source://addressable//lib/addressable/template.rb#40
810
+ Addressable::Template::RESERVED = T.let(T.unsafe(nil), String)
811
+
812
+ # Raised if an invalid template operator is used in a pattern.
813
+ #
814
+ # source://addressable//lib/addressable/template.rb#90
815
+ class Addressable::Template::TemplateOperatorAbortedError < ::StandardError; end
816
+
817
+ # source://addressable//lib/addressable/template.rb#42
818
+ Addressable::Template::UNRESERVED = T.let(T.unsafe(nil), String)
819
+
820
+ # source://addressable//lib/addressable/template.rb#54
821
+ Addressable::Template::VARIABLE_LIST = T.let(T.unsafe(nil), Regexp)
822
+
823
+ # source://addressable//lib/addressable/template.rb#50
824
+ Addressable::Template::VARNAME = T.let(T.unsafe(nil), Regexp)
825
+
826
+ # source://addressable//lib/addressable/template.rb#52
827
+ Addressable::Template::VARSPEC = T.let(T.unsafe(nil), Regexp)
828
+
829
+ # This is an implementation of a URI parser based on
830
+ # <a href="http://www.ietf.org/rfc/rfc3986.txt">RFC 3986</a>,
831
+ # <a href="http://www.ietf.org/rfc/rfc3987.txt">RFC 3987</a>.
832
+ #
833
+ # source://addressable//lib/addressable/uri.rb#31
834
+ class Addressable::URI
835
+ # Creates a new uri object from component parts.
836
+ #
837
+ # @option [String,
838
+ # @option [String,
839
+ # @option [String,
840
+ # @option [String,
841
+ # @option [String,
842
+ # @option [String,
843
+ # @option [String,
844
+ # @option [String,
845
+ # @option [String,
846
+ # @option [String,
847
+ # @param [String, [Hash] a customizable set of options
848
+ # @return [Addressable::URI] The constructed URI object.
849
+ #
850
+ # source://addressable//lib/addressable/uri.rb#824
851
+ def initialize(options = T.unsafe(nil)); end
852
+
853
+ # Joins two URIs together.
854
+ #
855
+ # @param The [String, Addressable::URI, #to_str] URI to join with.
856
+ # @return [Addressable::URI] The joined URI.
857
+ #
858
+ # source://addressable//lib/addressable/uri.rb#1898
859
+ def +(uri); end
860
+
861
+ # Returns <code>true</code> if the URI objects are equal. This method
862
+ # normalizes both URIs before doing the comparison.
863
+ #
864
+ # @param uri [Object] The URI to compare.
865
+ # @return [TrueClass, FalseClass] <code>true</code> if the URIs are equivalent, <code>false</code>
866
+ # otherwise.
867
+ #
868
+ # source://addressable//lib/addressable/uri.rb#2248
869
+ def ==(uri); end
870
+
871
+ # Returns <code>true</code> if the URI objects are equal. This method
872
+ # normalizes both URIs before doing the comparison, and allows comparison
873
+ # against <code>Strings</code>.
874
+ #
875
+ # @param uri [Object] The URI to compare.
876
+ # @return [TrueClass, FalseClass] <code>true</code> if the URIs are equivalent, <code>false</code>
877
+ # otherwise.
878
+ #
879
+ # source://addressable//lib/addressable/uri.rb#2226
880
+ def ===(uri); end
881
+
882
+ # Determines if the URI is absolute.
883
+ #
884
+ # @return [TrueClass, FalseClass] <code>true</code> if the URI is absolute. <code>false</code>
885
+ # otherwise.
886
+ #
887
+ # source://addressable//lib/addressable/uri.rb#1888
888
+ def absolute?; end
889
+
890
+ # The authority component for this URI.
891
+ # Combines the user, password, host, and port components.
892
+ #
893
+ # @return [String] The authority component.
894
+ #
895
+ # source://addressable//lib/addressable/uri.rb#1235
896
+ def authority; end
897
+
898
+ # Sets the authority component for this URI.
899
+ #
900
+ # @param new_authority [String, #to_str] The new authority component.
901
+ #
902
+ # source://addressable//lib/addressable/uri.rb#1275
903
+ def authority=(new_authority); end
904
+
905
+ # The basename, if any, of the file in the path component.
906
+ #
907
+ # @return [String] The path's basename.
908
+ #
909
+ # source://addressable//lib/addressable/uri.rb#1593
910
+ def basename; end
911
+
912
+ # The default port for this URI's scheme.
913
+ # This method will always returns the default port for the URI's scheme
914
+ # regardless of the presence of an explicit port in the URI.
915
+ #
916
+ # @return [Integer] The default port.
917
+ #
918
+ # source://addressable//lib/addressable/uri.rb#1457
919
+ def default_port; end
920
+
921
+ # This method allows you to make several changes to a URI simultaneously,
922
+ # which separately would cause validation errors, but in conjunction,
923
+ # are valid. The URI will be revalidated as soon as the entire block has
924
+ # been executed.
925
+ #
926
+ # @param block [Proc] A set of operations to perform on a given URI.
927
+ # @raise [LocalJumpError]
928
+ #
929
+ # source://addressable//lib/addressable/uri.rb#2405
930
+ def defer_validation; end
931
+
932
+ # Creates a URI suitable for display to users. If semantic attacks are
933
+ # likely, the application should try to detect these and warn the user.
934
+ # See <a href="http://www.ietf.org/rfc/rfc3986.txt">RFC 3986</a>,
935
+ # section 7.6 for more information.
936
+ #
937
+ # @return [Addressable::URI] A URI suitable for display purposes.
938
+ #
939
+ # source://addressable//lib/addressable/uri.rb#2210
940
+ def display_uri; end
941
+
942
+ # Returns the public suffix domain for this host.
943
+ #
944
+ # @example
945
+ # Addressable::URI.parse("http://www.example.co.uk").domain # => "example.co.uk"
946
+ #
947
+ # source://addressable//lib/addressable/uri.rb#1226
948
+ def domain; end
949
+
950
+ # Clones the URI object.
951
+ #
952
+ # @return [Addressable::URI] The cloned URI.
953
+ #
954
+ # source://addressable//lib/addressable/uri.rb#2280
955
+ def dup; end
956
+
957
+ # Determines if the URI is an empty string.
958
+ #
959
+ # @return [TrueClass, FalseClass] Returns <code>true</code> if empty, <code>false</code> otherwise.
960
+ #
961
+ # source://addressable//lib/addressable/uri.rb#2342
962
+ def empty?; end
963
+
964
+ # Returns <code>true</code> if the URI objects are equal. This method
965
+ # does NOT normalize either URI before doing the comparison.
966
+ #
967
+ # @param uri [Object] The URI to compare.
968
+ # @return [TrueClass, FalseClass] <code>true</code> if the URIs are equivalent, <code>false</code>
969
+ # otherwise.
970
+ #
971
+ # source://addressable//lib/addressable/uri.rb#2262
972
+ def eql?(uri); end
973
+
974
+ # The extname, if any, of the file in the path component.
975
+ # Empty string if there is no extension.
976
+ #
977
+ # @return [String] The path's extname.
978
+ #
979
+ # source://addressable//lib/addressable/uri.rb#1603
980
+ def extname; end
981
+
982
+ # The fragment component for this URI.
983
+ #
984
+ # @return [String] The fragment component.
985
+ #
986
+ # source://addressable//lib/addressable/uri.rb#1817
987
+ def fragment; end
988
+
989
+ # Sets the fragment component for this URI.
990
+ #
991
+ # @param new_fragment [String, #to_str] The new fragment component.
992
+ #
993
+ # source://addressable//lib/addressable/uri.rb#1844
994
+ def fragment=(new_fragment); end
995
+
996
+ # Freeze URI, initializing instance variables.
997
+ #
998
+ # @return [Addressable::URI] The frozen URI object.
999
+ #
1000
+ # source://addressable//lib/addressable/uri.rb#861
1001
+ def freeze; end
1002
+
1003
+ # A hash value that will make a URI equivalent to its normalized
1004
+ # form.
1005
+ #
1006
+ # @return [Integer] A hash of the URI.
1007
+ #
1008
+ # source://addressable//lib/addressable/uri.rb#2272
1009
+ def hash; end
1010
+
1011
+ # The host component for this URI.
1012
+ #
1013
+ # @return [String] The host component.
1014
+ #
1015
+ # source://addressable//lib/addressable/uri.rb#1119
1016
+ def host; end
1017
+
1018
+ # Sets the host component for this URI.
1019
+ #
1020
+ # @param new_host [String, #to_str] The new host component.
1021
+ #
1022
+ # source://addressable//lib/addressable/uri.rb#1157
1023
+ def host=(new_host); end
1024
+
1025
+ # This method is same as URI::Generic#host except
1026
+ # brackets for IPv6 (and 'IPvFuture') addresses are removed.
1027
+ #
1028
+ # @return [String] The hostname for this URI.
1029
+ # @see Addressable::URI#host
1030
+ #
1031
+ # source://addressable//lib/addressable/uri.rb#1179
1032
+ def hostname; end
1033
+
1034
+ # This method is same as URI::Generic#host= except
1035
+ # the argument can be a bare IPv6 address (or 'IPvFuture').
1036
+ #
1037
+ # @param new_hostname [String, #to_str] The new hostname for this URI.
1038
+ # @see Addressable::URI#host=
1039
+ #
1040
+ # source://addressable//lib/addressable/uri.rb#1191
1041
+ def hostname=(new_hostname); end
1042
+
1043
+ # The inferred port component for this URI.
1044
+ # This method will normalize to the default port for the URI's scheme if
1045
+ # the port isn't explicitly specified in the URI.
1046
+ #
1047
+ # @return [Integer] The inferred port component.
1048
+ #
1049
+ # source://addressable//lib/addressable/uri.rb#1443
1050
+ def inferred_port; end
1051
+
1052
+ # Returns a <code>String</code> representation of the URI object's state.
1053
+ #
1054
+ # @return [String] The URI object's state, as a <code>String</code>.
1055
+ #
1056
+ # source://addressable//lib/addressable/uri.rb#2393
1057
+ def inspect; end
1058
+
1059
+ # Determines if the scheme indicates an IP-based protocol.
1060
+ #
1061
+ # @return [TrueClass, FalseClass] <code>true</code> if the scheme indicates an IP-based protocol.
1062
+ # <code>false</code> otherwise.
1063
+ #
1064
+ # source://addressable//lib/addressable/uri.rb#1864
1065
+ def ip_based?; end
1066
+
1067
+ # Joins two URIs together.
1068
+ #
1069
+ # @param The [String, Addressable::URI, #to_str] URI to join with.
1070
+ # @return [Addressable::URI] The joined URI.
1071
+ #
1072
+ # source://addressable//lib/addressable/uri.rb#1898
1073
+ def join(uri); end
1074
+
1075
+ # Destructive form of <code>join</code>.
1076
+ #
1077
+ # @param The [String, Addressable::URI, #to_str] URI to join with.
1078
+ # @return [Addressable::URI] The joined URI.
1079
+ # @see Addressable::URI#join
1080
+ #
1081
+ # source://addressable//lib/addressable/uri.rb#2001
1082
+ def join!(uri); end
1083
+
1084
+ # Merges a URI with a <code>Hash</code> of components.
1085
+ # This method has different behavior from <code>join</code>. Any
1086
+ # components present in the <code>hash</code> parameter will override the
1087
+ # original components. The path component is not treated specially.
1088
+ #
1089
+ # @param The [Hash, Addressable::URI, #to_hash] components to merge with.
1090
+ # @return [Addressable::URI] The merged URI.
1091
+ # @see Hash#merge
1092
+ #
1093
+ # source://addressable//lib/addressable/uri.rb#2016
1094
+ def merge(hash); end
1095
+
1096
+ # Destructive form of <code>merge</code>.
1097
+ #
1098
+ # @param The [Hash, Addressable::URI, #to_hash] components to merge with.
1099
+ # @return [Addressable::URI] The merged URI.
1100
+ # @see Addressable::URI#merge
1101
+ #
1102
+ # source://addressable//lib/addressable/uri.rb#2081
1103
+ def merge!(uri); end
1104
+
1105
+ # Returns a normalized URI object.
1106
+ #
1107
+ # NOTE: This method does not attempt to fully conform to specifications.
1108
+ # It exists largely to correct other people's failures to read the
1109
+ # specifications, and also to deal with caching issues since several
1110
+ # different URIs may represent the same resource and should not be
1111
+ # cached multiple times.
1112
+ #
1113
+ # @return [Addressable::URI] The normalized URI.
1114
+ #
1115
+ # source://addressable//lib/addressable/uri.rb#2173
1116
+ def normalize; end
1117
+
1118
+ # Destructively normalizes this URI object.
1119
+ #
1120
+ # @return [Addressable::URI] The normalized URI.
1121
+ # @see Addressable::URI#normalize
1122
+ #
1123
+ # source://addressable//lib/addressable/uri.rb#2199
1124
+ def normalize!; end
1125
+
1126
+ # The authority component for this URI, normalized.
1127
+ #
1128
+ # @return [String] The authority component, normalized.
1129
+ #
1130
+ # source://addressable//lib/addressable/uri.rb#1253
1131
+ def normalized_authority; end
1132
+
1133
+ # The fragment component for this URI, normalized.
1134
+ #
1135
+ # @return [String] The fragment component, normalized.
1136
+ #
1137
+ # source://addressable//lib/addressable/uri.rb#1825
1138
+ def normalized_fragment; end
1139
+
1140
+ # The host component for this URI, normalized.
1141
+ #
1142
+ # @return [String] The host component, normalized.
1143
+ #
1144
+ # source://addressable//lib/addressable/uri.rb#1127
1145
+ def normalized_host; end
1146
+
1147
+ # The password component for this URI, normalized.
1148
+ #
1149
+ # @return [String] The password component, normalized.
1150
+ #
1151
+ # source://addressable//lib/addressable/uri.rb#999
1152
+ def normalized_password; end
1153
+
1154
+ # The path component for this URI, normalized.
1155
+ #
1156
+ # @return [String] The path component, normalized.
1157
+ #
1158
+ # source://addressable//lib/addressable/uri.rb#1540
1159
+ def normalized_path; end
1160
+
1161
+ # The port component for this URI, normalized.
1162
+ #
1163
+ # @return [Integer] The port component, normalized.
1164
+ #
1165
+ # source://addressable//lib/addressable/uri.rb#1395
1166
+ def normalized_port; end
1167
+
1168
+ # The query component for this URI, normalized.
1169
+ #
1170
+ # @return [String] The query component, normalized.
1171
+ #
1172
+ # source://addressable//lib/addressable/uri.rb#1620
1173
+ def normalized_query(*flags); end
1174
+
1175
+ # The scheme component for this URI, normalized.
1176
+ #
1177
+ # @return [String] The scheme component, normalized.
1178
+ #
1179
+ # source://addressable//lib/addressable/uri.rb#889
1180
+ def normalized_scheme; end
1181
+
1182
+ # The normalized combination of components that represent a site.
1183
+ # Combines the scheme, user, password, host, and port components.
1184
+ # Primarily useful for HTTP and HTTPS.
1185
+ #
1186
+ # For example, <code>"http://example.com/path?query"</code> would have a
1187
+ # <code>site</code> value of <code>"http://example.com"</code>.
1188
+ #
1189
+ # @return [String] The normalized components that identify a site.
1190
+ #
1191
+ # source://addressable//lib/addressable/uri.rb#1488
1192
+ def normalized_site; end
1193
+
1194
+ # The user component for this URI, normalized.
1195
+ #
1196
+ # @return [String] The user component, normalized.
1197
+ #
1198
+ # source://addressable//lib/addressable/uri.rb#942
1199
+ def normalized_user; end
1200
+
1201
+ # The userinfo component for this URI, normalized.
1202
+ #
1203
+ # @return [String] The userinfo component, normalized.
1204
+ #
1205
+ # source://addressable//lib/addressable/uri.rb#1067
1206
+ def normalized_userinfo; end
1207
+
1208
+ # Omits components from a URI.
1209
+ #
1210
+ # @example
1211
+ # uri = Addressable::URI.parse("http://example.com/path?query")
1212
+ # #=> #<Addressable::URI:0xcc5e7a URI:http://example.com/path?query>
1213
+ # uri.omit(:scheme, :authority)
1214
+ # #=> #<Addressable::URI:0xcc4d86 URI:/path?query>
1215
+ # @param *components [Symbol] The components to be omitted.
1216
+ # @return [Addressable::URI] The URI with components omitted.
1217
+ #
1218
+ # source://addressable//lib/addressable/uri.rb#2306
1219
+ def omit(*components); end
1220
+
1221
+ # Destructive form of omit.
1222
+ #
1223
+ # @param *components [Symbol] The components to be omitted.
1224
+ # @return [Addressable::URI] The URI with components omitted.
1225
+ # @see Addressable::URI#omit
1226
+ #
1227
+ # source://addressable//lib/addressable/uri.rb#2333
1228
+ def omit!(*components); end
1229
+
1230
+ # The origin for this URI, serialized to ASCII, as per
1231
+ # RFC 6454, section 6.2.
1232
+ #
1233
+ # @return [String] The serialized origin.
1234
+ #
1235
+ # source://addressable//lib/addressable/uri.rb#1315
1236
+ def origin; end
1237
+
1238
+ # Sets the origin for this URI, serialized to ASCII, as per
1239
+ # RFC 6454, section 6.2. This assignment will reset the `userinfo`
1240
+ # component.
1241
+ #
1242
+ # @param new_origin [String, #to_str] The new origin component.
1243
+ #
1244
+ # source://addressable//lib/addressable/uri.rb#1334
1245
+ def origin=(new_origin); end
1246
+
1247
+ # The password component for this URI.
1248
+ #
1249
+ # @return [String] The password component.
1250
+ #
1251
+ # source://addressable//lib/addressable/uri.rb#991
1252
+ def password; end
1253
+
1254
+ # Sets the password component for this URI.
1255
+ #
1256
+ # @param new_password [String, #to_str] The new password component.
1257
+ #
1258
+ # source://addressable//lib/addressable/uri.rb#1022
1259
+ def password=(new_password); end
1260
+
1261
+ # The path component for this URI.
1262
+ #
1263
+ # @return [String] The path component.
1264
+ #
1265
+ # source://addressable//lib/addressable/uri.rb#1531
1266
+ def path; end
1267
+
1268
+ # Sets the path component for this URI.
1269
+ #
1270
+ # @param new_path [String, #to_str] The new path component.
1271
+ #
1272
+ # source://addressable//lib/addressable/uri.rb#1572
1273
+ def path=(new_path); end
1274
+
1275
+ # The port component for this URI.
1276
+ # This is the port number actually given in the URI. This does not
1277
+ # infer port numbers from default values.
1278
+ #
1279
+ # @return [Integer] The port component.
1280
+ #
1281
+ # source://addressable//lib/addressable/uri.rb#1387
1282
+ def port; end
1283
+
1284
+ # Sets the port component for this URI.
1285
+ #
1286
+ # @param new_port [String, Integer, #to_s] The new port component.
1287
+ #
1288
+ # source://addressable//lib/addressable/uri.rb#1411
1289
+ def port=(new_port); end
1290
+
1291
+ # The query component for this URI.
1292
+ #
1293
+ # @return [String] The query component.
1294
+ #
1295
+ # source://addressable//lib/addressable/uri.rb#1612
1296
+ def query; end
1297
+
1298
+ # Sets the query component for this URI.
1299
+ #
1300
+ # @param new_query [String, #to_str] The new query component.
1301
+ #
1302
+ # source://addressable//lib/addressable/uri.rb#1648
1303
+ def query=(new_query); end
1304
+
1305
+ # Converts the query component to a Hash value.
1306
+ #
1307
+ # @example
1308
+ # Addressable::URI.parse("?one=1&two=2&three=3").query_values
1309
+ # #=> {"one" => "1", "two" => "2", "three" => "3"}
1310
+ # Addressable::URI.parse("?one=two&one=three").query_values(Array)
1311
+ # #=> [["one", "two"], ["one", "three"]]
1312
+ # Addressable::URI.parse("?one=two&one=three").query_values(Hash)
1313
+ # #=> {"one" => "three"}
1314
+ # Addressable::URI.parse("?").query_values
1315
+ # #=> {}
1316
+ # Addressable::URI.parse("").query_values
1317
+ # #=> nil
1318
+ # @param return_type [Class] The return type desired. Value must be either
1319
+ # `Hash` or `Array`.
1320
+ # @return [Hash, Array, nil] The query string parsed as a Hash or Array
1321
+ # or nil if the query string is blank.
1322
+ #
1323
+ # source://addressable//lib/addressable/uri.rb#1679
1324
+ def query_values(return_type = T.unsafe(nil)); end
1325
+
1326
+ # Sets the query component for this URI from a Hash object.
1327
+ # An empty Hash or Array will result in an empty query string.
1328
+ #
1329
+ # @example
1330
+ # uri.query_values = {:a => "a", :b => ["c", "d", "e"]}
1331
+ # uri.query
1332
+ # # => "a=a&b=c&b=d&b=e"
1333
+ # uri.query_values = [['a', 'a'], ['b', 'c'], ['b', 'd'], ['b', 'e']]
1334
+ # uri.query
1335
+ # # => "a=a&b=c&b=d&b=e"
1336
+ # uri.query_values = [['a', 'a'], ['b', ['c', 'd', 'e']]]
1337
+ # uri.query
1338
+ # # => "a=a&b=c&b=d&b=e"
1339
+ # uri.query_values = [['flag'], ['key', 'value']]
1340
+ # uri.query
1341
+ # # => "flag&key=value"
1342
+ # @param new_query_values [Hash, #to_hash, Array] The new query values.
1343
+ #
1344
+ # source://addressable//lib/addressable/uri.rb#1730
1345
+ def query_values=(new_query_values); end
1346
+
1347
+ # Determines if the URI is relative.
1348
+ #
1349
+ # @return [TrueClass, FalseClass] <code>true</code> if the URI is relative. <code>false</code>
1350
+ # otherwise.
1351
+ #
1352
+ # source://addressable//lib/addressable/uri.rb#1878
1353
+ def relative?; end
1354
+
1355
+ # The HTTP request URI for this URI. This is the path and the
1356
+ # query string.
1357
+ #
1358
+ # @return [String] The request URI required for an HTTP request.
1359
+ #
1360
+ # source://addressable//lib/addressable/uri.rb#1781
1361
+ def request_uri; end
1362
+
1363
+ # Sets the HTTP request URI for this URI.
1364
+ #
1365
+ # @param new_request_uri [String, #to_str] The new HTTP request URI.
1366
+ #
1367
+ # source://addressable//lib/addressable/uri.rb#1793
1368
+ def request_uri=(new_request_uri); end
1369
+
1370
+ # Returns the shortest normalized relative form of this URI that uses the
1371
+ # supplied URI as a base for resolution. Returns an absolute URI if
1372
+ # necessary. This is effectively the opposite of <code>route_to</code>.
1373
+ #
1374
+ # @param uri [String, Addressable::URI, #to_str] The URI to route from.
1375
+ # @return [Addressable::URI] The normalized relative URI that is equivalent to the original URI.
1376
+ #
1377
+ # source://addressable//lib/addressable/uri.rb#2094
1378
+ def route_from(uri); end
1379
+
1380
+ # Returns the shortest normalized relative form of the supplied URI that
1381
+ # uses this URI as a base for resolution. Returns an absolute URI if
1382
+ # necessary. This is effectively the opposite of <code>route_from</code>.
1383
+ #
1384
+ # @param uri [String, Addressable::URI, #to_str] The URI to route to.
1385
+ # @return [Addressable::URI] The normalized relative URI that is equivalent to the supplied URI.
1386
+ #
1387
+ # source://addressable//lib/addressable/uri.rb#2159
1388
+ def route_to(uri); end
1389
+
1390
+ # The scheme component for this URI.
1391
+ #
1392
+ # @return [String] The scheme component.
1393
+ #
1394
+ # source://addressable//lib/addressable/uri.rb#881
1395
+ def scheme; end
1396
+
1397
+ # Sets the scheme component for this URI.
1398
+ #
1399
+ # @param new_scheme [String, #to_str] The new scheme component.
1400
+ #
1401
+ # source://addressable//lib/addressable/uri.rb#910
1402
+ def scheme=(new_scheme); end
1403
+
1404
+ # The combination of components that represent a site.
1405
+ # Combines the scheme, user, password, host, and port components.
1406
+ # Primarily useful for HTTP and HTTPS.
1407
+ #
1408
+ # For example, <code>"http://example.com/path?query"</code> would have a
1409
+ # <code>site</code> value of <code>"http://example.com"</code>.
1410
+ #
1411
+ # @return [String] The components that identify a site.
1412
+ #
1413
+ # source://addressable//lib/addressable/uri.rb#1470
1414
+ def site; end
1415
+
1416
+ # Sets the site value for this URI.
1417
+ #
1418
+ # @param new_site [String, #to_str] The new site value.
1419
+ #
1420
+ # source://addressable//lib/addressable/uri.rb#1509
1421
+ def site=(new_site); end
1422
+
1423
+ # Returns the top-level domain for this host.
1424
+ #
1425
+ # @example
1426
+ # Addressable::URI.parse("http://www.example.co.uk").tld # => "co.uk"
1427
+ #
1428
+ # source://addressable//lib/addressable/uri.rb#1208
1429
+ def tld; end
1430
+
1431
+ # Sets the top-level domain for this URI.
1432
+ #
1433
+ # @param new_tld [String, #to_str] The new top-level domain.
1434
+ #
1435
+ # source://addressable//lib/addressable/uri.rb#1216
1436
+ def tld=(new_tld); end
1437
+
1438
+ # Returns a Hash of the URI components.
1439
+ #
1440
+ # @return [Hash] The URI as a <code>Hash</code> of components.
1441
+ #
1442
+ # source://addressable//lib/addressable/uri.rb#2376
1443
+ def to_hash; end
1444
+
1445
+ # Converts the URI to a <code>String</code>.
1446
+ #
1447
+ # @return [String] The URI's <code>String</code> representation.
1448
+ #
1449
+ # source://addressable//lib/addressable/uri.rb#2350
1450
+ def to_s; end
1451
+
1452
+ # Converts the URI to a <code>String</code>.
1453
+ # URI's are glorified <code>Strings</code>. Allow implicit conversion.
1454
+ #
1455
+ # @return [String] The URI's <code>String</code> representation.
1456
+ #
1457
+ # source://addressable//lib/addressable/uri.rb#2350
1458
+ def to_str; end
1459
+
1460
+ # The user component for this URI.
1461
+ #
1462
+ # @return [String] The user component.
1463
+ #
1464
+ # source://addressable//lib/addressable/uri.rb#934
1465
+ def user; end
1466
+
1467
+ # Sets the user component for this URI.
1468
+ #
1469
+ # @param new_user [String, #to_str] The new user component.
1470
+ #
1471
+ # source://addressable//lib/addressable/uri.rb#965
1472
+ def user=(new_user); end
1473
+
1474
+ # The userinfo component for this URI.
1475
+ # Combines the user and password components.
1476
+ #
1477
+ # @return [String] The userinfo component.
1478
+ #
1479
+ # source://addressable//lib/addressable/uri.rb#1051
1480
+ def userinfo; end
1481
+
1482
+ # Sets the userinfo component for this URI.
1483
+ #
1484
+ # @param new_userinfo [String, #to_str] The new userinfo component.
1485
+ #
1486
+ # source://addressable//lib/addressable/uri.rb#1090
1487
+ def userinfo=(new_userinfo); end
1488
+
1489
+ protected
1490
+
1491
+ # Converts the string to be UTF-8 if it is not already UTF-8
1492
+ #
1493
+ # @api private
1494
+ #
1495
+ # source://addressable//lib/addressable/uri.rb#2554
1496
+ def force_utf8_encoding_if_needed(str); end
1497
+
1498
+ # Resets composite values for the entire URI
1499
+ #
1500
+ # @api private
1501
+ #
1502
+ # source://addressable//lib/addressable/uri.rb#2545
1503
+ def remove_composite_values; end
1504
+
1505
+ # Replaces the internal state of self with the specified URI's state.
1506
+ # Used in destructive operations to avoid massive code repetition.
1507
+ #
1508
+ # @param uri [Addressable::URI] The URI to replace <code>self</code> with.
1509
+ # @return [Addressable::URI] <code>self</code>.
1510
+ #
1511
+ # source://addressable//lib/addressable/uri.rb#2508
1512
+ def replace_self(uri); end
1513
+
1514
+ # Splits path string with "/" (slash).
1515
+ # It is considered that there is empty string after last slash when
1516
+ # path ends with slash.
1517
+ #
1518
+ # @param path [String] The path to split.
1519
+ # @return [Array<String>] An array of parts of path.
1520
+ #
1521
+ # source://addressable//lib/addressable/uri.rb#2535
1522
+ def split_path(path); end
1523
+
1524
+ # Ensures that the URI is valid.
1525
+ #
1526
+ # source://addressable//lib/addressable/uri.rb#2465
1527
+ def validate; end
1528
+
1529
+ class << self
1530
+ # Converts a path to a file scheme URI. If the path supplied is
1531
+ # relative, it will be returned as a relative URI. If the path supplied
1532
+ # is actually a non-file URI, it will parse the URI as if it had been
1533
+ # parsed with <code>Addressable::URI.parse</code>. Handles all of the
1534
+ # various Microsoft-specific formats for specifying paths.
1535
+ #
1536
+ # @example
1537
+ # base = Addressable::URI.convert_path("/absolute/path/")
1538
+ # uri = Addressable::URI.convert_path("relative/path")
1539
+ # (base + uri).to_s
1540
+ # #=> "file:///absolute/path/relative/path"
1541
+ #
1542
+ # Addressable::URI.convert_path(
1543
+ # "c:\\windows\\My Documents 100%20\\foo.txt"
1544
+ # ).to_s
1545
+ # #=> "file:///c:/windows/My%20Documents%20100%20/foo.txt"
1546
+ #
1547
+ # Addressable::URI.convert_path("http://example.com/").to_s
1548
+ # #=> "http://example.com/"
1549
+ # @param path [String, Addressable::URI, #to_str] Typically a <code>String</code> path to a file or directory, but
1550
+ # will return a sensible return value if an absolute URI is supplied
1551
+ # instead.
1552
+ # @return [Addressable::URI] The parsed file scheme URI or the original URI if some other URI
1553
+ # scheme was provided.
1554
+ #
1555
+ # source://addressable//lib/addressable/uri.rb#279
1556
+ def convert_path(path); end
1557
+
1558
+ # Percent encodes any special characters in the URI.
1559
+ #
1560
+ # @param uri [String, Addressable::URI, #to_str] The URI to encode.
1561
+ # @param return_type [Class] The type of object to return.
1562
+ # This value may only be set to <code>String</code> or
1563
+ # <code>Addressable::URI</code>. All other values are invalid. Defaults
1564
+ # to <code>String</code>.
1565
+ # @return [String, Addressable::URI] The encoded URI.
1566
+ # The return type is determined by the <code>return_type</code>
1567
+ # parameter.
1568
+ #
1569
+ # source://addressable//lib/addressable/uri.rb#609
1570
+ def encode(uri, return_type = T.unsafe(nil)); end
1571
+
1572
+ # Percent encodes a URI component.
1573
+ #
1574
+ # '9' to be percent encoded. If a <code>Regexp</code> is passed, the
1575
+ # value <code>/[^b-zB-Z0-9]/</code> would have the same effect. A set of
1576
+ # useful <code>String</code> values may be found in the
1577
+ # <code>Addressable::URI::CharacterClasses</code> module. The default
1578
+ # value is the reserved plus unreserved character classes specified in
1579
+ # <a href="http://www.ietf.org/rfc/rfc3986.txt">RFC 3986</a>.
1580
+ #
1581
+ # @example
1582
+ # Addressable::URI.encode_component("simple/example", "b-zB-Z0-9")
1583
+ # => "simple%2Fex%61mple"
1584
+ # Addressable::URI.encode_component("simple/example", /[^b-zB-Z0-9]/)
1585
+ # => "simple%2Fex%61mple"
1586
+ # Addressable::URI.encode_component(
1587
+ # "simple/example", Addressable::URI::CharacterClasses::UNRESERVED
1588
+ # )
1589
+ # => "simple%2Fexample"
1590
+ # @param component [String, #to_str] The URI component to encode.
1591
+ # @param character_class [String, Regexp] The characters which are not percent encoded. If a <code>String</code>
1592
+ # is passed, the <code>String</code> must be formatted as a regular
1593
+ # expression character class. (Do not include the surrounding square
1594
+ # brackets.) For example, <code>"b-zB-Z0-9"</code> would cause
1595
+ # everything but the letters 'b' through 'z' and the numbers '0' through
1596
+ # @param upcase_encoded [Regexp] A string of characters that may already be percent encoded, and whose
1597
+ # encodings should be upcased. This allows normalization of percent
1598
+ # encodings for characters not included in the
1599
+ # <code>character_class</code>.
1600
+ # @return [String] The encoded component.
1601
+ #
1602
+ # source://addressable//lib/addressable/uri.rb#394
1603
+ def encode_component(component, character_class = T.unsafe(nil), upcase_encoded = T.unsafe(nil)); end
1604
+
1605
+ # Percent encodes any special characters in the URI.
1606
+ #
1607
+ # @param uri [String, Addressable::URI, #to_str] The URI to encode.
1608
+ # @param return_type [Class] The type of object to return.
1609
+ # This value may only be set to <code>String</code> or
1610
+ # <code>Addressable::URI</code>. All other values are invalid. Defaults
1611
+ # to <code>String</code>.
1612
+ # @return [String, Addressable::URI] The encoded URI.
1613
+ # The return type is determined by the <code>return_type</code>
1614
+ # parameter.
1615
+ #
1616
+ # source://addressable//lib/addressable/uri.rb#609
1617
+ def escape(uri, return_type = T.unsafe(nil)); end
1618
+
1619
+ # Percent encodes a URI component.
1620
+ #
1621
+ # '9' to be percent encoded. If a <code>Regexp</code> is passed, the
1622
+ # value <code>/[^b-zB-Z0-9]/</code> would have the same effect. A set of
1623
+ # useful <code>String</code> values may be found in the
1624
+ # <code>Addressable::URI::CharacterClasses</code> module. The default
1625
+ # value is the reserved plus unreserved character classes specified in
1626
+ # <a href="http://www.ietf.org/rfc/rfc3986.txt">RFC 3986</a>.
1627
+ #
1628
+ # @example
1629
+ # Addressable::URI.encode_component("simple/example", "b-zB-Z0-9")
1630
+ # => "simple%2Fex%61mple"
1631
+ # Addressable::URI.encode_component("simple/example", /[^b-zB-Z0-9]/)
1632
+ # => "simple%2Fex%61mple"
1633
+ # Addressable::URI.encode_component(
1634
+ # "simple/example", Addressable::URI::CharacterClasses::UNRESERVED
1635
+ # )
1636
+ # => "simple%2Fexample"
1637
+ # @param component [String, #to_str] The URI component to encode.
1638
+ # @param character_class [String, Regexp] The characters which are not percent encoded. If a <code>String</code>
1639
+ # is passed, the <code>String</code> must be formatted as a regular
1640
+ # expression character class. (Do not include the surrounding square
1641
+ # brackets.) For example, <code>"b-zB-Z0-9"</code> would cause
1642
+ # everything but the letters 'b' through 'z' and the numbers '0' through
1643
+ # @param upcase_encoded [Regexp] A string of characters that may already be percent encoded, and whose
1644
+ # encodings should be upcased. This allows normalization of percent
1645
+ # encodings for characters not included in the
1646
+ # <code>character_class</code>.
1647
+ # @return [String] The encoded component.
1648
+ #
1649
+ # source://addressable//lib/addressable/uri.rb#394
1650
+ def escape_component(component, character_class = T.unsafe(nil), upcase_encoded = T.unsafe(nil)); end
1651
+
1652
+ # Encodes a set of key/value pairs according to the rules for the
1653
+ # <code>application/x-www-form-urlencoded</code> MIME type.
1654
+ #
1655
+ # @param form_values [#to_hash, #to_ary] The form values to encode.
1656
+ # @param sort [TrueClass, FalseClass] Sort the key/value pairs prior to encoding.
1657
+ # Defaults to <code>false</code>.
1658
+ # @return [String] The encoded value.
1659
+ #
1660
+ # source://addressable//lib/addressable/uri.rb#734
1661
+ def form_encode(form_values, sort = T.unsafe(nil)); end
1662
+
1663
+ # Decodes a <code>String</code> according to the rules for the
1664
+ # <code>application/x-www-form-urlencoded</code> MIME type.
1665
+ #
1666
+ # @param encoded_value [String, #to_str] The form values to decode.
1667
+ # @return [Array] The decoded values.
1668
+ # This is not a <code>Hash</code> because of the possibility for
1669
+ # duplicate keys.
1670
+ #
1671
+ # source://addressable//lib/addressable/uri.rb#787
1672
+ def form_unencode(encoded_value); end
1673
+
1674
+ # Converts an input to a URI. The input does not have to be a valid
1675
+ # URI — the method will use heuristics to guess what URI was intended.
1676
+ # This is not standards-compliant, merely user-friendly.
1677
+ #
1678
+ # @param uri [String, Addressable::URI, #to_str] The URI string to parse.
1679
+ # No parsing is performed if the object is already an
1680
+ # <code>Addressable::URI</code>.
1681
+ # @param hints [Hash] A <code>Hash</code> of hints to the heuristic parser.
1682
+ # Defaults to <code>{:scheme => "http"}</code>.
1683
+ # @return [Addressable::URI] The parsed URI.
1684
+ #
1685
+ # source://addressable//lib/addressable/uri.rb#178
1686
+ def heuristic_parse(uri, hints = T.unsafe(nil)); end
1687
+
1688
+ # Returns an array of known ip-based schemes. These schemes typically
1689
+ # use a similar URI form:
1690
+ # <code>//<user>:<password>@<host>:<port>/<url-path></code>
1691
+ #
1692
+ # source://addressable//lib/addressable/uri.rb#1370
1693
+ def ip_based_schemes; end
1694
+
1695
+ # Joins several URIs together.
1696
+ #
1697
+ # @example
1698
+ # base = "http://example.com/"
1699
+ # uri = Addressable::URI.parse("relative/path")
1700
+ # Addressable::URI.join(base, uri)
1701
+ # #=> #<Addressable::URI:0xcab390 URI:http://example.com/relative/path>
1702
+ # @param *uris [String, Addressable::URI, #to_str] The URIs to join.
1703
+ # @return [Addressable::URI] The joined URI.
1704
+ #
1705
+ # source://addressable//lib/addressable/uri.rb#330
1706
+ def join(*uris); end
1707
+
1708
+ # Normalizes the encoding of a URI component.
1709
+ #
1710
+ # @example
1711
+ # Addressable::URI.normalize_component("simpl%65/%65xampl%65", "b-zB-Z")
1712
+ # => "simple%2Fex%61mple"
1713
+ # Addressable::URI.normalize_component(
1714
+ # "simpl%65/%65xampl%65", /[^b-zB-Z]/
1715
+ # )
1716
+ # => "simple%2Fex%61mple"
1717
+ # Addressable::URI.normalize_component(
1718
+ # "simpl%65/%65xampl%65",
1719
+ # Addressable::URI::CharacterClasses::UNRESERVED
1720
+ # )
1721
+ # => "simple%2Fexample"
1722
+ # Addressable::URI.normalize_component(
1723
+ # "one%20two%2fthree%26four",
1724
+ # "0-9a-zA-Z &/",
1725
+ # "/"
1726
+ # )
1727
+ # => "one two%2Fthree&four"
1728
+ # @param component [String, #to_str] The URI component to encode.
1729
+ # @param character_class [String, Regexp] The characters which are not percent encoded. If a <code>String</code>
1730
+ # is passed, the <code>String</code> must be formatted as a regular
1731
+ # expression character class. (Do not include the surrounding square
1732
+ # brackets.) For example, <code>"b-zB-Z0-9"</code> would cause
1733
+ # everything but the letters 'b' through 'z' and the numbers '0'
1734
+ # through '9' to be percent encoded. If a <code>Regexp</code> is passed,
1735
+ # the value <code>/[^b-zB-Z0-9]/</code> would have the same effect. A
1736
+ # set of useful <code>String</code> values may be found in the
1737
+ # <code>Addressable::URI::CharacterClasses</code> module. The default
1738
+ # value is the reserved plus unreserved character classes specified in
1739
+ # <a href="http://www.ietf.org/rfc/rfc3986.txt">RFC 3986</a>.
1740
+ # @param leave_encoded [String] When <code>character_class</code> is a <code>String</code> then
1741
+ # <code>leave_encoded</code> is a string of characters that should remain
1742
+ # percent encoded while normalizing the component; if they appear percent
1743
+ # encoded in the original component, then they will be upcased ("%2f"
1744
+ # normalized to "%2F") but otherwise left alone.
1745
+ # @return [String] The normalized component.
1746
+ #
1747
+ # source://addressable//lib/addressable/uri.rb#544
1748
+ def normalize_component(component, character_class = T.unsafe(nil), leave_encoded = T.unsafe(nil)); end
1749
+
1750
+ # Resolves paths to their simplest form.
1751
+ #
1752
+ # @param path [String] The path to normalize.
1753
+ # @return [String] The normalized path.
1754
+ #
1755
+ # source://addressable//lib/addressable/uri.rb#2429
1756
+ def normalize_path(path); end
1757
+
1758
+ # Normalizes the encoding of a URI. Characters within a hostname are
1759
+ # not percent encoded to allow for internationalized domain names.
1760
+ #
1761
+ # @param uri [String, Addressable::URI, #to_str] The URI to encode.
1762
+ # @param return_type [Class] The type of object to return.
1763
+ # This value may only be set to <code>String</code> or
1764
+ # <code>Addressable::URI</code>. All other values are invalid. Defaults
1765
+ # to <code>String</code>.
1766
+ # @return [String, Addressable::URI] The encoded URI.
1767
+ # The return type is determined by the <code>return_type</code>
1768
+ # parameter.
1769
+ #
1770
+ # source://addressable//lib/addressable/uri.rb#664
1771
+ def normalized_encode(uri, return_type = T.unsafe(nil)); end
1772
+
1773
+ # Returns a URI object based on the parsed string.
1774
+ #
1775
+ # @param uri [String, Addressable::URI, #to_str] The URI string to parse.
1776
+ # No parsing is performed if the object is already an
1777
+ # <code>Addressable::URI</code>.
1778
+ # @return [Addressable::URI] The parsed URI.
1779
+ #
1780
+ # source://addressable//lib/addressable/uri.rb#101
1781
+ def parse(uri); end
1782
+
1783
+ # Returns a hash of common IP-based schemes and their default port
1784
+ # numbers. Adding new schemes to this hash, as necessary, will allow
1785
+ # for better URI normalization.
1786
+ #
1787
+ # source://addressable//lib/addressable/uri.rb#1377
1788
+ def port_mapping; end
1789
+
1790
+ # Unencodes any percent encoded characters within a URI component.
1791
+ # This method may be used for unencoding either components or full URIs,
1792
+ # however, it is recommended to use the <code>unencode_component</code>
1793
+ # alias when unencoding components.
1794
+ #
1795
+ # @param uri [String, Addressable::URI, #to_str] The URI or component to unencode.
1796
+ # @param return_type [Class] The type of object to return.
1797
+ # This value may only be set to <code>String</code> or
1798
+ # <code>Addressable::URI</code>. All other values are invalid. Defaults
1799
+ # to <code>String</code>.
1800
+ # @param leave_encoded [String] A string of characters to leave encoded. If a percent encoded character
1801
+ # in this list is encountered then it will remain percent encoded.
1802
+ # @return [String, Addressable::URI] The unencoded component or URI.
1803
+ # The return type is determined by the <code>return_type</code>
1804
+ # parameter.
1805
+ #
1806
+ # source://addressable//lib/addressable/uri.rb#464
1807
+ def unencode(uri, return_type = T.unsafe(nil), leave_encoded = T.unsafe(nil)); end
1808
+
1809
+ # Unencodes any percent encoded characters within a URI component.
1810
+ # This method may be used for unencoding either components or full URIs,
1811
+ # however, it is recommended to use the <code>unencode_component</code>
1812
+ # alias when unencoding components.
1813
+ #
1814
+ # @param uri [String, Addressable::URI, #to_str] The URI or component to unencode.
1815
+ # @param return_type [Class] The type of object to return.
1816
+ # This value may only be set to <code>String</code> or
1817
+ # <code>Addressable::URI</code>. All other values are invalid. Defaults
1818
+ # to <code>String</code>.
1819
+ # @param leave_encoded [String] A string of characters to leave encoded. If a percent encoded character
1820
+ # in this list is encountered then it will remain percent encoded.
1821
+ # @return [String, Addressable::URI] The unencoded component or URI.
1822
+ # The return type is determined by the <code>return_type</code>
1823
+ # parameter.
1824
+ #
1825
+ # source://addressable//lib/addressable/uri.rb#464
1826
+ def unencode_component(uri, return_type = T.unsafe(nil), leave_encoded = T.unsafe(nil)); end
1827
+
1828
+ # Unencodes any percent encoded characters within a URI component.
1829
+ # This method may be used for unencoding either components or full URIs,
1830
+ # however, it is recommended to use the <code>unencode_component</code>
1831
+ # alias when unencoding components.
1832
+ #
1833
+ # @param uri [String, Addressable::URI, #to_str] The URI or component to unencode.
1834
+ # @param return_type [Class] The type of object to return.
1835
+ # This value may only be set to <code>String</code> or
1836
+ # <code>Addressable::URI</code>. All other values are invalid. Defaults
1837
+ # to <code>String</code>.
1838
+ # @param leave_encoded [String] A string of characters to leave encoded. If a percent encoded character
1839
+ # in this list is encountered then it will remain percent encoded.
1840
+ # @return [String, Addressable::URI] The unencoded component or URI.
1841
+ # The return type is determined by the <code>return_type</code>
1842
+ # parameter.
1843
+ #
1844
+ # source://addressable//lib/addressable/uri.rb#464
1845
+ def unescape(uri, return_type = T.unsafe(nil), leave_encoded = T.unsafe(nil)); end
1846
+
1847
+ # Unencodes any percent encoded characters within a URI component.
1848
+ # This method may be used for unencoding either components or full URIs,
1849
+ # however, it is recommended to use the <code>unencode_component</code>
1850
+ # alias when unencoding components.
1851
+ #
1852
+ # @param uri [String, Addressable::URI, #to_str] The URI or component to unencode.
1853
+ # @param return_type [Class] The type of object to return.
1854
+ # This value may only be set to <code>String</code> or
1855
+ # <code>Addressable::URI</code>. All other values are invalid. Defaults
1856
+ # to <code>String</code>.
1857
+ # @param leave_encoded [String] A string of characters to leave encoded. If a percent encoded character
1858
+ # in this list is encountered then it will remain percent encoded.
1859
+ # @return [String, Addressable::URI] The unencoded component or URI.
1860
+ # The return type is determined by the <code>return_type</code>
1861
+ # parameter.
1862
+ #
1863
+ # source://addressable//lib/addressable/uri.rb#464
1864
+ def unescape_component(uri, return_type = T.unsafe(nil), leave_encoded = T.unsafe(nil)); end
1865
+ end
1866
+ end
1867
+
1868
+ # Container for the character classes specified in
1869
+ # <a href="http://www.ietf.org/rfc/rfc3986.txt">RFC 3986</a>.
1870
+ #
1871
+ # Note: Concatenated and interpolated `String`s are not affected by the
1872
+ # `frozen_string_literal` directive and must be frozen explicitly.
1873
+ #
1874
+ # Interpolated `String`s *were* frozen this way before Ruby 3.0:
1875
+ # https://bugs.ruby-lang.org/issues/17104
1876
+ #
1877
+ # source://addressable//lib/addressable/uri.rb#46
1878
+ module Addressable::URI::CharacterClasses; end
1879
+
1880
+ # source://addressable//lib/addressable/uri.rb#47
1881
+ Addressable::URI::CharacterClasses::ALPHA = T.let(T.unsafe(nil), String)
1882
+
1883
+ # source://addressable//lib/addressable/uri.rb#56
1884
+ Addressable::URI::CharacterClasses::AUTHORITY = T.let(T.unsafe(nil), String)
1885
+
1886
+ # source://addressable//lib/addressable/uri.rb#48
1887
+ Addressable::URI::CharacterClasses::DIGIT = T.let(T.unsafe(nil), String)
1888
+
1889
+ # source://addressable//lib/addressable/uri.rb#59
1890
+ Addressable::URI::CharacterClasses::FRAGMENT = T.let(T.unsafe(nil), String)
1891
+
1892
+ # source://addressable//lib/addressable/uri.rb#49
1893
+ Addressable::URI::CharacterClasses::GEN_DELIMS = T.let(T.unsafe(nil), String)
1894
+
1895
+ # source://addressable//lib/addressable/uri.rb#55
1896
+ Addressable::URI::CharacterClasses::HOST = T.let(T.unsafe(nil), String)
1897
+
1898
+ # source://addressable//lib/addressable/uri.rb#57
1899
+ Addressable::URI::CharacterClasses::PATH = T.let(T.unsafe(nil), String)
1900
+
1901
+ # source://addressable//lib/addressable/uri.rb#53
1902
+ Addressable::URI::CharacterClasses::PCHAR = T.let(T.unsafe(nil), String)
1903
+
1904
+ # source://addressable//lib/addressable/uri.rb#58
1905
+ Addressable::URI::CharacterClasses::QUERY = T.let(T.unsafe(nil), String)
1906
+
1907
+ # source://addressable//lib/addressable/uri.rb#51
1908
+ Addressable::URI::CharacterClasses::RESERVED = T.let(T.unsafe(nil), String)
1909
+
1910
+ # source://addressable//lib/addressable/uri.rb#54
1911
+ Addressable::URI::CharacterClasses::SCHEME = T.let(T.unsafe(nil), String)
1912
+
1913
+ # source://addressable//lib/addressable/uri.rb#50
1914
+ Addressable::URI::CharacterClasses::SUB_DELIMS = T.let(T.unsafe(nil), String)
1915
+
1916
+ # source://addressable//lib/addressable/uri.rb#52
1917
+ Addressable::URI::CharacterClasses::UNRESERVED = T.let(T.unsafe(nil), String)
1918
+
1919
+ # source://addressable//lib/addressable/uri.rb#72
1920
+ Addressable::URI::EMPTY_STR = T.let(T.unsafe(nil), String)
1921
+
1922
+ # Raised if something other than a uri is supplied.
1923
+ #
1924
+ # source://addressable//lib/addressable/uri.rb#34
1925
+ class Addressable::URI::InvalidURIError < ::StandardError; end
1926
+
1927
+ # source://addressable//lib/addressable/uri.rb#1535
1928
+ Addressable::URI::NORMPATH = T.let(T.unsafe(nil), Regexp)
1929
+
1930
+ # source://addressable//lib/addressable/uri.rb#62
1931
+ module Addressable::URI::NormalizeCharacterClasses; end
1932
+
1933
+ # source://addressable//lib/addressable/uri.rb#67
1934
+ Addressable::URI::NormalizeCharacterClasses::FRAGMENT = T.let(T.unsafe(nil), Regexp)
1935
+
1936
+ # source://addressable//lib/addressable/uri.rb#63
1937
+ Addressable::URI::NormalizeCharacterClasses::HOST = T.let(T.unsafe(nil), Regexp)
1938
+
1939
+ # source://addressable//lib/addressable/uri.rb#65
1940
+ Addressable::URI::NormalizeCharacterClasses::PCHAR = T.let(T.unsafe(nil), Regexp)
1941
+
1942
+ # source://addressable//lib/addressable/uri.rb#68
1943
+ Addressable::URI::NormalizeCharacterClasses::QUERY = T.let(T.unsafe(nil), Regexp)
1944
+
1945
+ # source://addressable//lib/addressable/uri.rb#66
1946
+ Addressable::URI::NormalizeCharacterClasses::SCHEME = T.let(T.unsafe(nil), Regexp)
1947
+
1948
+ # source://addressable//lib/addressable/uri.rb#64
1949
+ Addressable::URI::NormalizeCharacterClasses::UNRESERVED = T.let(T.unsafe(nil), Regexp)
1950
+
1951
+ # source://addressable//lib/addressable/uri.rb#2416
1952
+ Addressable::URI::PARENT = T.let(T.unsafe(nil), String)
1953
+
1954
+ # source://addressable//lib/addressable/uri.rb#76
1955
+ Addressable::URI::PORT_MAPPING = T.let(T.unsafe(nil), Hash)
1956
+
1957
+ # source://addressable//lib/addressable/uri.rb#2418
1958
+ Addressable::URI::RULE_2A = T.let(T.unsafe(nil), Regexp)
1959
+
1960
+ # source://addressable//lib/addressable/uri.rb#2419
1961
+ Addressable::URI::RULE_2B_2C = T.let(T.unsafe(nil), Regexp)
1962
+
1963
+ # source://addressable//lib/addressable/uri.rb#2420
1964
+ Addressable::URI::RULE_2D = T.let(T.unsafe(nil), Regexp)
1965
+
1966
+ # source://addressable//lib/addressable/uri.rb#2421
1967
+ Addressable::URI::RULE_PREFIXED_PARENT = T.let(T.unsafe(nil), Regexp)
1968
+
1969
+ # source://addressable//lib/addressable/uri.rb#2415
1970
+ Addressable::URI::SELF_REF = T.let(T.unsafe(nil), String)
1971
+
1972
+ # Tables used to optimize encoding operations in `self.encode_component`
1973
+ # and `self.normalize_component`
1974
+ #
1975
+ # source://addressable//lib/addressable/uri.rb#347
1976
+ Addressable::URI::SEQUENCE_ENCODING_TABLE = T.let(T.unsafe(nil), Hash)
1977
+
1978
+ # source://addressable//lib/addressable/uri.rb#353
1979
+ Addressable::URI::SEQUENCE_UPCASED_PERCENT_ENCODING_TABLE = T.let(T.unsafe(nil), Hash)
1980
+
1981
+ # source://addressable//lib/addressable/uri.rb#71
1982
+ Addressable::URI::SLASH = T.let(T.unsafe(nil), String)
1983
+
1984
+ # source://addressable//lib/addressable/uri.rb#74
1985
+ Addressable::URI::URIREGEX = T.let(T.unsafe(nil), Regexp)
1986
+
1987
+ # source://addressable//lib/addressable/version.rb#23
1988
+ module Addressable::VERSION; end
1989
+
1990
+ # source://addressable//lib/addressable/version.rb#24
1991
+ Addressable::VERSION::MAJOR = T.let(T.unsafe(nil), Integer)
1992
+
1993
+ # source://addressable//lib/addressable/version.rb#25
1994
+ Addressable::VERSION::MINOR = T.let(T.unsafe(nil), Integer)
1995
+
1996
+ # source://addressable//lib/addressable/version.rb#28
1997
+ Addressable::VERSION::STRING = T.let(T.unsafe(nil), String)
1998
+
1999
+ # source://addressable//lib/addressable/version.rb#26
2000
+ Addressable::VERSION::TINY = T.let(T.unsafe(nil), Integer)