module Conjur::Escape
Provides helpers for escaping url components.
The helpers are added as both class and isntance methods.
Public Class Methods
@api private
# File lib/conjur/escape.rb, line 89 def self.included(base) base.extend ClassMethods end
Public Instance Methods
URL escape the entire string. This is essentially the same as calling ‘CGI.escape str`.
@example
fully_escape 'foo/bar@baz' # => "foo%2Fbar%40baz"
@param [String] str the string to escape @return [String] the escaped string @see Conjur::Escape::ClassMethods#fully_escape
# File lib/conjur/escape.rb, line 102 def fully_escape(str) self.class.fully_escape str end
Escape
a URI path component.
This method simply calls {Conjur::Escape::ClassMethods#path_or_query_escape}.
@param [String] str the string to escape @return [String] the escaped string @see Conjur::Escape::ClassMethods#path_or_query_escape
# File lib/conjur/escape.rb, line 113 def path_escape(str) self.class.path_escape str end
Escape
a URI query value.
This method simply calls {Conjur::Escape::ClassMethods#path_or_query_escape}.
@param [String] str the string to escape @return [String] the escaped string @see Conjur::Escape::ClassMethods#path_or_query_escape
# File lib/conjur/escape.rb, line 125 def query_escape(str) self.class.query_escape str end