Module: Conjur::Escape
- Included in:
- API, Annotations, 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
.
104 105 106 |
# File 'lib/conjur/escape.rb', line 104 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.
115 116 117 |
# File 'lib/conjur/escape.rb', line 115 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.
127 128 129 |
# File 'lib/conjur/escape.rb', line 127 def query_escape(str) self.class.query_escape str end |