Module: RapidJSON

Defined in:
lib/rapidjson.rb,
lib/rapidjson.rb,
lib/rapidjson/version.rb,
lib/rapidjson/json_gem.rb,
lib/rapidjson/active_support_encoder.rb

Defined Under Namespace

Modules: JSONGem Classes: ActiveSupportEncoder, Coder, EncodeError, Error, Fragment, ParseError

Constant Summary collapse

VERSION =
"0.4.0"

Class Method Summary collapse

Class Method Details

.dump(object) ⇒ Object Also known as: encode



36
37
38
# File 'lib/rapidjson.rb', line 36

def dump(object)
  DEFAULT_CODER.dump(object)
end

.json_escapeObject

.json_ready?(obj) ⇒ Boolean

Returns:

  • (Boolean)


126
127
128
129
# File 'ext/rapidjson/cext.cc', line 126

static VALUE
json_ready_p(VALUE _self, VALUE obj) {
    return is_json_ready(obj) ? Qtrue : Qfalse;
}

.load(string) ⇒ Object Also known as: parse



31
32
33
# File 'lib/rapidjson.rb', line 31

def load(string)
  DEFAULT_CODER.load(string)
end

.pretty_encode(object) ⇒ Object



41
42
43
# File 'lib/rapidjson.rb', line 41

def pretty_encode(object)
  PRETTY_CODER.dump(object)
end

.valid_json?(string) ⇒ Boolean

Returns:

  • (Boolean)


45
46
47
# File 'lib/rapidjson.rb', line 45

def valid_json?(string)
  DEFAULT_CODER.valid_json?(string)
end