-
Notifications
You must be signed in to change notification settings - Fork 129
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,20 @@ | |||
require 'jrjackson_r' unless defined?(::JrJackson) | |||
require 'multi_json/adapters/ok_json' | |||
|
|||
module MultiJson | |||
module Adapters | |||
class Jrjackson < MultiJson::Adapters::OkJson | |||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
sferik
Member
|
|||
ParseError = ::Java::OrgCodehausJackson::JsonParseException | |||
|
|||
def load(string, options={}) #:nodoc: | |||
string = string.read if string.respond_to?(:read) | |||
result = ::JrJackson::Json.parse(string) | |||
options[:symbolize_keys] ? symbolize_keys(result) : result | |||
end | |||
|
|||
def dump(object, options={}) #:nodoc: | |||
::JrJackson::Json.generate(prepare_object(object){ |value| value }) | |||
end | |||
end | |||
end | |||
end |
I'm a little late to the party, but should this be "JrJackson"? Or was the name deliberately changed?