Module: Conjur::Escape
- Included in:
- API, RestClient::Resource
- Defined in:
- lib/conjur/escape.rb
Overview
Provides helpers for escaping url components.
The helpers are added as both class and isntance methods.
Defined Under Namespace
Modules: ClassMethods
Instance Method Summary collapse
-
#fully_escape(str) ⇒ String
URL escape the entire string.
-
#path_escape(str) ⇒ String
Escape a URI path component.
-
#query_escape(str) ⇒ String
Escape a URI query value.
Instance Method Details
#fully_escape(str) ⇒ String
URL escape the entire string. This is essentially the same as calling CGI.escape str
.
97 98 99 |
# File 'lib/conjur/escape.rb', line 97 def fully_escape(str) self.class.fully_escape str end |
#path_escape(str) ⇒ String
Escape a URI path component.
This method simply calls Conjur::Escape::ClassMethods#path_or_query_escape.
108 109 110 |
# File 'lib/conjur/escape.rb', line 108 def path_escape(str) self.class.path_escape str end |
#query_escape(str) ⇒ String
Escape a URI query value.
This method simply calls Conjur::Escape::ClassMethods#path_or_query_escape.
120 121 122 |
# File 'lib/conjur/escape.rb', line 120 def query_escape(str) self.class.query_escape str end |