Method: DSTK::DSTK#u
- Defined in:
- lib/dstk.rb
#u(str) ⇒ Object
A short-hand method to URL encode a string. See web.elctech.com/?p=58
37 38 39 |
# File 'lib/dstk.rb', line 37 def u(str) str.gsub(/[^a-zA-Z0-9_\.\-]/n) {|s| sprintf('%%%02x', s[0]) } end |