Sha256: e7d9a102b46878a3ad8dc827b9a40e6191c8185211f6afba73d4f6a344f36e5b

Contents?: true

Size: 632 Bytes

Versions: 13

Compression:

Stored size: 632 Bytes

Contents

require 'jrjackson_r' unless defined?(::JrJackson)
require 'multi_json/adapter'
require 'multi_json/convertible_hash_keys'

module MultiJson
  module Adapters
    class JrJackson < Adapter
      include ConvertibleHashKeys
      ParseError = ::Java::OrgCodehausJackson::JsonParseException

      def load(string, options={})
        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={})
        ::JrJackson::Json.generate(stringify_keys(object))
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 5 rubygems

Version Path
font-awesome-rails-3.1.1.2 vendor/ruby/1.9.1/gems/multi_json-1.7.2/lib/multi_json/adapters/jr_jackson.rb
vagrant-shell-0.2.6 vendor/bundle/gems/multi_json-1.7.2/lib/multi_json/adapters/jr_jackson.rb
font-awesome-rails-3.1.1.1 vendor/ruby/1.9.1/gems/multi_json-1.7.2/lib/multi_json/adapters/jr_jackson.rb
challah-1.0.0.beta3 vendor/bundle/gems/multi_json-1.7.2/lib/multi_json/adapters/jr_jackson.rb
vagrant-shell-0.2.5 vendor/bundle/gems/multi_json-1.7.2/lib/multi_json/adapters/jr_jackson.rb
fc-webicons-0.0.4 vendor/bundle/ruby/1.9.1/gems/multi_json-1.7.2/lib/multi_json/adapters/jr_jackson.rb
challah-1.0.0.beta2 vendor/bundle/gems/multi_json-1.7.2/lib/multi_json/adapters/jr_jackson.rb
challah-1.0.0.beta vendor/bundle/gems/multi_json-1.7.2/lib/multi_json/adapters/jr_jackson.rb
fc-webicons-0.0.3 vendor/bundle/ruby/1.9.1/gems/multi_json-1.7.2/lib/multi_json/adapters/jr_jackson.rb
fc-webicons-0.0.2 vendor/bundle/ruby/1.9.1/gems/multi_json-1.7.2/lib/multi_json/adapters/jr_jackson.rb
fc-webicons-0.0.1 vendor/bundle/ruby/1.9.1/gems/multi_json-1.7.2/lib/multi_json/adapters/jr_jackson.rb
multi_json-1.7.2 lib/multi_json/adapters/jr_jackson.rb
multi_json-1.7.1 lib/multi_json/adapters/jrjackson.rb