@@ -159,9 +159,11 @@ def self.scheme_list
159
159
Schemes . list
160
160
end
161
161
162
+ # :stopdoc:
162
163
INITIAL_SCHEMES = scheme_list
163
164
private_constant :INITIAL_SCHEMES
164
165
Ractor . make_shareable ( INITIAL_SCHEMES ) if defined? ( Ractor )
166
+ # :startdoc:
165
167
166
168
# Returns a new object constructed from the given +scheme+, +arguments+,
167
169
# and +default+:
@@ -437,6 +439,8 @@ def self.decode_uri_component(str, enc=Encoding::UTF_8)
437
439
_decode_uri_component ( /%\h \h / , str , enc )
438
440
end
439
441
442
+ # Returns a string derived from the given string +str+ with
443
+ # URI-encoded characters matching +regexp+ according to +table+.
440
444
def self . _encode_uri_component ( regexp , table , str , enc )
441
445
str = str . to_s . dup
442
446
if str . encoding != Encoding ::ASCII_8BIT
@@ -451,6 +455,8 @@ def self._encode_uri_component(regexp, table, str, enc)
451
455
end
452
456
private_class_method :_encode_uri_component
453
457
458
+ # Returns a string decoding characters matching +regexp+ from the
459
+ # given \URL-encoded string +str+.
454
460
def self . _decode_uri_component ( regexp , str , enc )
455
461
raise ArgumentError , "invalid %-encoding (#{ str } )" if /%(?!\h \h )/ . match? ( str )
456
462
str . b . gsub ( regexp , TBLDECWWWCOMP_ ) . force_encoding ( enc )
0 commit comments