Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →
class · Ruby 4.1
CGI
< Object
include CGI::Escape
Since Ruby 4.0, CGI is a small holder for various escaping methods, included from CGI::Escape
Example
require 'cgi/escape' CGI.escape("Ruby programming language") #=> "Ruby+programming+language" CGI.escapeURIComponent("Ruby programming language") #=> "Ruby%20programming%20language"
See CGI::Escape module for methods list and their description.