Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/AnonR/smanonr..../opt/alt/ruby27/share/ruby
File: json.rb
#frozen_string_literal: false
[0] Fix | Delete
require 'json/common'
[1] Fix | Delete
[2] Fix | Delete
##
[3] Fix | Delete
# = JavaScript Object Notation (JSON)
[4] Fix | Delete
#
[5] Fix | Delete
# JSON is a lightweight data-interchange format. It is easy for us
[6] Fix | Delete
# humans to read and write. Plus, equally simple for machines to generate or parse.
[7] Fix | Delete
# JSON is completely language agnostic, making it the ideal interchange format.
[8] Fix | Delete
#
[9] Fix | Delete
# Built on two universally available structures:
[10] Fix | Delete
# 1. A collection of name/value pairs. Often referred to as an _object_, hash table, record, struct, keyed list, or associative array.
[11] Fix | Delete
# 2. An ordered list of values. More commonly called an _array_, vector, sequence or list.
[12] Fix | Delete
#
[13] Fix | Delete
# To read more about JSON visit: http://json.org
[14] Fix | Delete
#
[15] Fix | Delete
# == Parsing JSON
[16] Fix | Delete
#
[17] Fix | Delete
# To parse a JSON string received by another application or generated within
[18] Fix | Delete
# your existing application:
[19] Fix | Delete
#
[20] Fix | Delete
# require 'json'
[21] Fix | Delete
#
[22] Fix | Delete
# my_hash = JSON.parse('{"hello": "goodbye"}')
[23] Fix | Delete
# puts my_hash["hello"] => "goodbye"
[24] Fix | Delete
#
[25] Fix | Delete
# Notice the extra quotes <tt>''</tt> around the hash notation. Ruby expects
[26] Fix | Delete
# the argument to be a string and can't convert objects like a hash or array.
[27] Fix | Delete
#
[28] Fix | Delete
# Ruby converts your string into a hash
[29] Fix | Delete
#
[30] Fix | Delete
# == Generating JSON
[31] Fix | Delete
#
[32] Fix | Delete
# Creating a JSON string for communication or serialization is
[33] Fix | Delete
# just as simple.
[34] Fix | Delete
#
[35] Fix | Delete
# require 'json'
[36] Fix | Delete
#
[37] Fix | Delete
# my_hash = {:hello => "goodbye"}
[38] Fix | Delete
# puts JSON.generate(my_hash) => "{\"hello\":\"goodbye\"}"
[39] Fix | Delete
#
[40] Fix | Delete
# Or an alternative way:
[41] Fix | Delete
#
[42] Fix | Delete
# require 'json'
[43] Fix | Delete
# puts {:hello => "goodbye"}.to_json => "{\"hello\":\"goodbye\"}"
[44] Fix | Delete
#
[45] Fix | Delete
# <tt>JSON.generate</tt> only allows objects or arrays to be converted
[46] Fix | Delete
# to JSON syntax. <tt>to_json</tt>, however, accepts many Ruby classes
[47] Fix | Delete
# even though it acts only as a method for serialization:
[48] Fix | Delete
#
[49] Fix | Delete
# require 'json'
[50] Fix | Delete
#
[51] Fix | Delete
# 1.to_json => "1"
[52] Fix | Delete
#
[53] Fix | Delete
module JSON
[54] Fix | Delete
require 'json/version'
[55] Fix | Delete
[56] Fix | Delete
begin
[57] Fix | Delete
require 'json/ext'
[58] Fix | Delete
rescue LoadError
[59] Fix | Delete
require 'json/pure'
[60] Fix | Delete
end
[61] Fix | Delete
end
[62] Fix | Delete
[63] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function