Sha256: 14e8725648cc8ff042f8278c733ef272740b9b8030533bebfa7e11417a5807cd

Contents?: true

Size: 522 Bytes

Versions: 56

Compression:

Stored size: 522 Bytes

Contents

require 'oj' unless defined?(::Oj)

module MultiJson
  module Adapters
    # Use the Oj library to dump/load.
    class Oj
      ParseError = SyntaxError

      ::Oj.default_options = {:mode => :compat}

      def self.load(string, options={}) #:nodoc:
        ::Oj.load(string, :symbol_keys => options[:symbolize_keys])
      end

      def self.dump(object, options={}) #:nodoc:
        options.merge!(:indent => 2) if options[:pretty] || options['pretty']
        ::Oj.dump(object, options)
      end
    end
  end
end

Version data entries

56 entries across 56 versions & 5 rubygems

Version Path
classiccms-0.5.13 vendor/bundle/gems/multi_json-1.3.5/lib/multi_json/adapters/oj.rb
classiccms-0.5.12 vendor/bundle/gems/multi_json-1.3.5/lib/multi_json/adapters/oj.rb
classiccms-0.5.11 vendor/bundle/gems/multi_json-1.3.5/lib/multi_json/adapters/oj.rb
classiccms-0.5.10 vendor/bundle/gems/multi_json-1.3.5/lib/multi_json/adapters/oj.rb
classiccms-0.5.9 vendor/bundle/gems/multi_json-1.3.5/lib/multi_json/adapters/oj.rb
classiccms-0.5.8 vendor/bundle/gems/multi_json-1.3.5/lib/multi_json/adapters/oj.rb
classiccms-0.5.7 vendor/bundle/gems/multi_json-1.3.5/lib/multi_json/adapters/oj.rb
classiccms-0.5.6 vendor/bundle/gems/multi_json-1.3.5/lib/multi_json/adapters/oj.rb
classiccms-0.5.5 vendor/bundle/gems/multi_json-1.3.5/lib/multi_json/adapters/oj.rb
classiccms-0.5.2 vendor/bundle/gems/multi_json-1.3.5/lib/multi_json/adapters/oj.rb
classiccms-0.5.1 vendor/bundle/gems/multi_json-1.3.5/lib/multi_json/adapters/oj.rb
classiccms-0.5.0 vendor/bundle/gems/multi_json-1.3.5/lib/multi_json/adapters/oj.rb
classiccms-0.4.2 vendor/bundle/gems/multi_json-1.3.5/lib/multi_json/adapters/oj.rb
classiccms-0.4.1 vendor/bundle/gems/multi_json-1.3.5/lib/multi_json/adapters/oj.rb
classiccms-0.4.0 vendor/bundle/gems/multi_json-1.3.5/lib/multi_json/adapters/oj.rb
classiccms-0.3.9 vendor/bundle/gems/multi_json-1.3.5/lib/multi_json/adapters/oj.rb
challah-0.6.2 vendor/bundle/gems/multi_json-1.3.5/lib/multi_json/adapters/oj.rb
sunrise-cms-0.3.3 vendor/bundle/ruby/1.9.1/gems/multi_json-1.3.5/lib/multi_json/adapters/oj.rb
sunrise-cms-0.3.2 vendor/bundle/ruby/1.9.1/gems/multi_json-1.3.5/lib/multi_json/adapters/oj.rb
sunrise-cms-0.3.1 vendor/bundle/ruby/1.9.1/gems/multi_json-1.3.5/lib/multi_json/adapters/oj.rb