Module: Tire::Utils

Extended by:
Utils
Included in:
Utils
Defined in:
lib/tire/utils.rb

Instance Method Summary collapse

Instance Method Details

#escape(s) ⇒ Object


6
7
8
# File 'lib/tire/utils.rb', line 6

def escape(s)
  URI.encode_www_form_component(s.to_s)
end

#unescape(s) ⇒ Object


10
11
12
13
# File 'lib/tire/utils.rb', line 10

def unescape(s)
  s = s.to_s.respond_to?(:force_encoding) ? s.to_s.force_encoding(Encoding::UTF_8) : s.to_s
  URI.decode_www_form_component(s)
end