Sha256: 60da63b08fcebbd5d9304795a5fc33b1fe5aa96ba466596bd37059eff2b6a707

Contents?: true

Size: 609 Bytes

Versions: 67

Compression:

Stored size: 609 Bytes

Contents

require 'multi_json/adapter'
require 'multi_json/convertible_hash_keys'
require 'multi_json/vendor/okjson'

module MultiJson
  module Adapters
    class OkJson < Adapter
      include ConvertibleHashKeys
      ParseError = ::MultiJson::OkJson::Error

      def load(string, options={})
        string = string.read if string.respond_to?(:read)
        result = ::MultiJson::OkJson.decode("[#{string}]").first
        options[:symbolize_keys] ? symbolize_keys(result) : result
      end

      def dump(object, options={})
        ::MultiJson::OkJson.valenc(stringify_keys(object))
      end
    end
  end
end

Version data entries

67 entries across 65 versions & 10 rubygems

Version Path
multi_json-1.8.0 lib/multi_json/adapters/ok_json.rb
multi_json-1.7.9 lib/multi_json/adapters/ok_json.rb
multi_json-1.7.8 lib/multi_json/adapters/ok_json.rb
challah-1.0.0 vendor/bundle/gems/multi_json-1.7.7/lib/multi_json/adapters/ok_json.rb
swipe-rails-0.0.5 vendor/bundle/gems/multi_json-1.7.7/lib/multi_json/adapters/ok_json.rb
multi_json-1.7.7 lib/multi_json/adapters/ok_json.rb
multi_json-1.7.6 lib/multi_json/adapters/ok_json.rb
multi_json-1.7.5 lib/multi_json/adapters/ok_json.rb
multi_json-1.7.4 lib/multi_json/adapters/ok_json.rb
font-awesome-rails-3.1.1.2 vendor/ruby/1.9.1/gems/multi_json-1.7.2/lib/multi_json/adapters/ok_json.rb
vagrant-shell-0.2.6 vendor/bundle/gems/multi_json-1.7.2/lib/multi_json/adapters/ok_json.rb
font-awesome-rails-3.1.1.1 vendor/ruby/1.9.1/gems/multi_json-1.7.2/lib/multi_json/adapters/ok_json.rb
challah-1.0.0.beta3 vendor/bundle/gems/multi_json-1.7.3/lib/multi_json/adapters/ok_json.rb
challah-1.0.0.beta3 vendor/bundle/gems/multi_json-1.7.2/lib/multi_json/adapters/ok_json.rb
sidekiq-statsd-0.1.1 vendor/ruby/1.9.1/gems/multi_json-1.7.3/lib/multi_json/adapters/ok_json.rb
sidekiq-statsd-0.1.0 vendor/ruby/1.9.1/gems/multi_json-1.7.3/lib/multi_json/adapters/ok_json.rb
vagrant-shell-0.2.5 vendor/bundle/gems/multi_json-1.7.2/lib/multi_json/adapters/ok_json.rb
multi_json-1.7.3 lib/multi_json/adapters/ok_json.rb
fc-webicons-0.0.4 vendor/bundle/ruby/1.9.1/gems/multi_json-1.7.2/lib/multi_json/adapters/ok_json.rb
challah-1.0.0.beta2 vendor/bundle/gems/multi_json-1.7.2/lib/multi_json/adapters/ok_json.rb