Module: WorkOS::Util
- Defined in:
- lib/workos/util.rb,
lib/workos/util/signature.rb
Defined Under Namespace
Modules: Signature
Class Method Summary collapse
-
.encode_path(value) ⇒ Object
Percent-encode a value for use in a URL path segment (RFC 3986).
Class Method Details
.encode_path(value) ⇒ Object
Percent-encode a value for use in a URL path segment (RFC 3986). Unlike CGI.escape, spaces become %20 instead of +.
10 11 12 13 14 |
# File 'lib/workos/util.rb', line 10 def self.encode_path(value) str = value.to_s raise ArgumentError, "path segment cannot be nil or empty" if str.empty? CGI.escape(str).gsub("+", "%20") end |