Class: String

Inherits:
Object show all
Defined in:
lib/extensions/unescape.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#unescapeString (frozen)

String#unescape -> String

String#unescape method unescapes input JSON strings.

Returns:



9
10
11
12
# File 'lib/extensions/unescape.rb', line 9

def unescape
  string = gsub(/(?<!\\)(\\\")/, "\"")
  string.gsub(/(?<!\\)(\\\\\")/, "\\\"")
end