Sha256: 68a8375a17084d5f238041beec98f56b14af66b4136655731cdbc7be749b87c0

Contents?: true

Size: 906 Bytes

Versions: 1

Compression:

Stored size: 906 Bytes

Contents

require "multi_json-jr_jackson/version"
require 'json' # Must be first as JrJackson tries to be king of JSON otherwise
require 'jrjackson'
require 'multi_json'

module MultiJson
  class JrJackson # Must be `class` as MultiJson lets any "Class" through without validation

    def self.dump(object, options = {})
      ::JrJackson::Json.generate(object)
    end

    def self.load(string, options = {})
      ::MultiJson::JrJackson::DeserializationEngine.load(string, options)
    end

    ##
    # Instance dump/load
    #
    def dump(object, options = {})
      self.class.dump(object, options)
    end

    def load(string, options = {})
      self.class.load(string, options)
    end

  end
end

::MultiJson::JrJackson::DeserializationEngine = ::MultiJson.engine
::MultiJson::JrJackson::ParseError = ::MultiJson::JrJackson::DeserializationEngine::ParseError
::MultiJson.engine = ::MultiJson::JrJackson

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
multi_json-jr_jackson-0.0.1 lib/multi_json-jr_jackson.rb