Class: String
Overview
:nodoc:
Instance Method Summary collapse
-
#unescape ⇒ String
String#unescape -> String.
Instance Method Details
#unescape ⇒ String
String#unescape -> String
String#unescape method unescapes input JSON strings.
9 10 11 12 |
# File 'lib/extensions/unescape.rb', line 9 def unescape string = gsub(/(?<!\\)(\\")/, '"') string.gsub(/(?<!\\)(\\\\")/, '\"') end |