All Downloads are FREE. Search and download functionalities are using the official Maven repository.

gems.multi_json-1.11.2.lib.multi_json.adapters.yajl.rb Maven / Gradle / Ivy

There is a newer version: 3.7.2
Show newest version
require 'yajl'
require 'multi_json/adapter'

module MultiJson
  module Adapters
    # Use the Yajl-Ruby library to dump/load.
    class Yajl < Adapter
      ParseError = ::Yajl::ParseError

      def load(string, options={})
        ::Yajl::Parser.new(:symbolize_keys => options[:symbolize_keys]).parse(string)
      end

      def dump(object, options={})
        ::Yajl::Encoder.encode(object, options)
      end
    end
  end
end




© 2015 - 2025 Weber Informatics LLC | Privacy Policy