Module: Riak::Util::Escape
- Included in:
- Bucket, Client, Client::HTTPBackend, Link, MapReduce, RObject, RObject, WalkSpec
- Defined in:
- riak-client/lib/riak/util/escape.rb
Overview
Methods for escaping URL segments.
Instance Method Summary (collapse)
-
- (String) escape(bucket_or_key)
CGI-escapes bucket or key names that may contain slashes for use in URLs.
-
- (String) unescape(bucket_or_key)
CGI-unescapes bucket or key names.
Instance Method Details
- (String) escape(bucket_or_key)
CGI-escapes bucket or key names that may contain slashes for use in URLs.
23 24 25 |
# File 'riak-client/lib/riak/util/escape.rb', line 23 def escape(bucket_or_key) CGI.escape(bucket_or_key.to_s).gsub("+", "%20") end |
- (String) unescape(bucket_or_key)
CGI-unescapes bucket or key names
30 31 32 |
# File 'riak-client/lib/riak/util/escape.rb', line 30 def unescape(bucket_or_key) CGI.unescape(bucket_or_key.to_s) end |