Class: ActionDispatch::Journey::Router::Utils::UriEncoder
Do not use. This class is for internal use only.
Relationships & Source Files | |
Inherits: | Object |
Defined in: | actionpack/lib/action_dispatch/journey/router/utils.rb |
Overview
URI path and fragment escaping tools.ietf.org/html/rfc3986
Constant Summary
-
ALPHA =
# File 'actionpack/lib/action_dispatch/journey/router/utils.rb', line 41"a-zA-Z"
-
DEC2HEX =
# File 'actionpack/lib/action_dispatch/journey/router/utils.rb', line 39(0..255).map { |i| (ENCODE % i).force_encoding(US_ASCII) }
-
DIGIT =
# File 'actionpack/lib/action_dispatch/journey/router/utils.rb', line 42"0-9"
-
EMPTY =
# File 'actionpack/lib/action_dispatch/journey/router/utils.rb', line 38(+"").force_encoding(US_ASCII).freeze
-
ENCODE =
# File 'actionpack/lib/action_dispatch/journey/router/utils.rb', line 35"%%%02X"
-
ESCAPED =
# File 'actionpack/lib/action_dispatch/journey/router/utils.rb', line 46/%[a-zA-Z0-9]{2}/
-
FRAGMENT =
# File 'actionpack/lib/action_dispatch/journey/router/utils.rb', line 48/[^#{UNRESERVED}#{SUB_DELIMS}:@\/?]/
-
PATH =
# File 'actionpack/lib/action_dispatch/journey/router/utils.rb', line 50/[^#{UNRESERVED}#{SUB_DELIMS}:@\/]/
-
SEGMENT =
# File 'actionpack/lib/action_dispatch/journey/router/utils.rb', line 49/[^#{UNRESERVED}#{SUB_DELIMS}:@]/
-
SUB_DELIMS =
# File 'actionpack/lib/action_dispatch/journey/router/utils.rb', line 44"!\\$&'\\(\\)\\*\\+,;="
-
UNRESERVED =
# File 'actionpack/lib/action_dispatch/journey/router/utils.rb', line 43"#{ALPHA}#{DIGIT}\\-\\._~"
-
US_ASCII =
# File 'actionpack/lib/action_dispatch/journey/router/utils.rb', line 36Encoding::US_ASCII
-
UTF_8 =
# File 'actionpack/lib/action_dispatch/journey/router/utils.rb', line 37Encoding::UTF_8
Instance Method Summary
Instance Method Details
#escape(component, pattern) (private)
[ GitHub ]# File 'actionpack/lib/action_dispatch/journey/router/utils.rb', line 70
def escape(component, pattern) component.gsub(pattern) { |unsafe| percent_encode(unsafe) }.force_encoding(US_ASCII) end