Sha256: 72ef73ef825824c299ce28fbff637367283feac8fb08c2632a4b1acac0a8fe01

Contents?: true

Size: 617 Bytes

Versions: 29

Compression:

Stored size: 617 Bytes

Contents

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

module MultiJson
  module Adapters
    # Use the Oj library to dump/load.
    class Oj
      ParseError = if defined?(::Oj::ParseError)
        ::Oj::ParseError
      else
        SyntaxError
      end

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

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

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

Version data entries

29 entries across 19 versions & 11 rubygems

Version Path
challah-1.0.0.beta vendor/bundle/gems/multi_json-1.4.0/lib/multi_json/adapters/oj.rb
graphael-on-rails-0.5.1 vendor/bundle/gems/multi_json-1.5.0/lib/multi_json/adapters/oj.rb
graphael-on-rails-0.0.1 vendor/bundle/gems/multi_json-1.5.0/lib/multi_json/adapters/oj.rb
challah-0.9.1.beta.3 vendor/bundle/gems/multi_json-1.4.0/lib/multi_json/adapters/oj.rb
devise_sociable-0.1.0 vendor/bundle/gems/multi_json-1.5.0/lib/multi_json/adapters/oj.rb
backbone-queryparams-rails-0.0.1 vendor/bundle/gems/multi_json-1.5.0/lib/multi_json/adapters/oj.rb
railscast-assets-0.0.2 vendor/bundle/gems/backbone-forms-on-rails-0.10.0/vendor/bundle/gems/multi_json-1.5.0/lib/multi_json/adapters/oj.rb
railscast-assets-0.0.2 vendor/bundle/gems/multi_json-1.5.0/lib/multi_json/adapters/oj.rb
backbone-forms-on-rails-0.10.0 vendor/bundle/gems/backbone-forms-on-rails-0.10.0/vendor/bundle/gems/multi_json-1.5.0/lib/multi_json/adapters/oj.rb
backbone-forms-on-rails-0.10.0 vendor/bundle/gems/multi_json-1.5.0/lib/multi_json/adapters/oj.rb
backbone-deep-rails-0.0.1 vendor/bundle/gems/multi_json-1.5.0/lib/multi_json/adapters/oj.rb
challah-0.9.1.beta vendor/bundle/gems/multi_json-1.4.0/lib/multi_json/adapters/oj.rb
sunrise-cms-0.5.0.rc1 vendor/bundle/ruby/1.9.1/gems/multi_json-1.5.0/lib/multi_json/adapters/oj.rb
challah-0.9.0 vendor/bundle/gems/multi_json-1.4.0/lib/multi_json/adapters/oj.rb
jquery_regex-0.0.3 vendor/bundle/gems/jquery_regex-0.0.2/vendor/bundle/gems/multi_json-1.5.0/lib/multi_json/adapters/oj.rb
jquery_regex-0.0.3 vendor/bundle/gems/jquery_regex-0.0.1/vendor/bundle/gems/multi_json-1.5.0/lib/multi_json/adapters/oj.rb
jquery_regex-0.0.3 vendor/bundle/gems/jquery_regex-0.0.2/vendor/bundle/gems/jquery_regex-0.0.1/vendor/bundle/gems/multi_json-1.5.0/lib/multi_json/adapters/oj.rb
jquery_regex-0.0.3 vendor/bundle/gems/jquery_regex-0.0.3/vendor/bundle/gems/jquery_regex-0.0.1/vendor/bundle/gems/multi_json-1.5.0/lib/multi_json/adapters/oj.rb
jquery_regex-0.0.3 vendor/bundle/gems/jquery_regex-0.0.3/vendor/bundle/gems/jquery_regex-0.0.2/vendor/bundle/gems/jquery_regex-0.0.1/vendor/bundle/gems/multi_json-1.5.0/lib/multi_json/adapters/oj.rb
jquery_regex-0.0.3 vendor/bundle/gems/jquery_regex-0.0.3/vendor/bundle/gems/jquery_regex-0.0.2/vendor/bundle/gems/multi_json-1.5.0/lib/multi_json/adapters/oj.rb