Class: MultiJson::Adapters::JrJackson

Inherits:
MultiJson::Adapter show all
Defined in:
lib/multi_json/adapters/jr_jackson.rb

Overview

Use the jrjackson.rb library to dump/load.

Constant Summary

ParseError =
::JrJackson::ParseError

Instance Method Summary (collapse)

Methods inherited from MultiJson::Adapter

defaults, dump, load

Methods included from Options

#default_dump_options, #default_load_options, #dump_options, #dump_options=, #load_options, #load_options=

Instance Method Details

- (Object) dump(object, options = {})

:nodoc:



16
17
18
# File 'lib/multi_json/adapters/jr_jackson.rb', line 16

def dump(object, options={}) #:nodoc:
  ::JrJackson::Json.dump(object)
end

- (Object) load(string, options = {})

:nodoc:



10
11
12
13
14
# File 'lib/multi_json/adapters/jr_jackson.rb', line 10

def load(string, options={}) #:nodoc:
  # https://github.com/guyboertje/jrjackson/issues/20
  string = string.read if StringIO === string
  ::JrJackson::Json.load(string, options)
end