Class: String

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

Constant Summary collapse

JS_ESCAPE_MAP =
{
  '\\'    => '\\\\',
  '</'    => '<\/',
  "\r\n"  => '\n',
  "\n"    => '\n',
  "\r"    => '\n',
  "\t"    => '\t',
  '"'     => '\\"',
  "'"     => "\'"
}

Instance Method Summary collapse

Instance Method Details

#to_builderObject



27
28
29
# File 'lib/json_builder/extensions.rb', line 27

def to_builder
  %("#{json_escape}")
end