Module: URITemplate::Utils::Escaping::EscapeUtils
Overview
A escaping module, which is backed by escape_utils. The performance is good, espacially for strings with many escaped characters.
Instance Method Summary collapse
- #escape_uri(s) ⇒ Object
- #escape_url(s) ⇒ Object
- #unescape_uri(s) ⇒ Object
- #unescape_url(s) ⇒ Object
- #using_escape_utils? ⇒ Boolean
Instance Method Details
#escape_uri(s) ⇒ Object
214 215 216 |
# File 'lib/uri_template/utils.rb', line 214 def escape_uri(s) super(to_utf8(s.to_s)) end |
#escape_url(s) ⇒ Object
210 211 212 |
# File 'lib/uri_template/utils.rb', line 210 def escape_url(s) super(to_utf8(s.to_s)).gsub('+','%20') end |
#unescape_uri(s) ⇒ Object
222 223 224 |
# File 'lib/uri_template/utils.rb', line 222 def unescape_uri(s) force_utf8(super(to_ascii(s.to_s))) end |
#unescape_url(s) ⇒ Object
218 219 220 |
# File 'lib/uri_template/utils.rb', line 218 def unescape_url(s) force_utf8(super(to_ascii(s.to_s))) end |
#using_escape_utils? ⇒ Boolean
206 207 208 |
# File 'lib/uri_template/utils.rb', line 206 def using_escape_utils? true end |