Module MultiJson
In: lib/multi_json/adapter.rb
lib/multi_json/load_error.rb
lib/multi_json/vendor/okjson.rb
lib/multi_json/version.rb
lib/multi_json/options.rb
lib/multi_json/convertible_hash_keys.rb
lib/multi_json/adapters/jr_jackson.rb
lib/multi_json/adapters/ok_json.rb
lib/multi_json/adapters/json_common.rb
lib/multi_json/adapters/gson.rb
lib/multi_json/adapters/json_gem.rb
lib/multi_json/adapters/oj.rb
lib/multi_json/adapters/nsjsonserialization.rb
lib/multi_json/adapters/json_pure.rb
lib/multi_json/adapters/yajl.rb
lib/multi_json.rb

Methods

Included Modules

Options

Classes and Modules

Module MultiJson::Adapters
Module MultiJson::ConvertibleHashKeys
Module MultiJson::OkJson
Module MultiJson::Options
Class MultiJson::Adapter
Class MultiJson::LoadError
Class MultiJson::Version

Constants

DecodeError = LoadError # Legacy support
VERSION = Version.to_s.freeze
ALIASES = { 'jrjackson' => 'jr_jackson' }
REQUIREMENT_MAP = [ ['oj', :oj], ['yajl', :yajl], ['jrjackson', :jr_jackson], ['json/ext', :json_gem], ['gson', :gson], ['json/pure', :json_pure]

External Aliases

dump_options -> default_options
  Since `default_options` is deprecated, the reader is aliased to `dump_options` and the writer sets both `dump_options` and `load_options`

Public Class methods

Public Instance methods

Get the current adapter class.

adapter=(new_adapter)

Alias for use

decode(string, options={})

Alias for load

The default adapter based on what you currently have loaded and installed. First checks to see if any adapters are already loaded, then checks to see which are installed if none are loaded.

default_engine()

Alias for default_adapter

Encodes a Ruby object as JSON.

encode(object, options={})

Alias for dump

engine()

Alias for adapter

engine=(new_adapter)

Alias for use

Decode a JSON string into Ruby.

Options

:symbolize_keys :If true, will use symbols instead of strings for the keys.
:adapter :If set, the selected adapter will be used for this call.

Set the JSON parser utilizing a symbol, string, or class. Supported by default are:

  • :oj
  • :json_gem
  • :json_pure
  • :ok_json
  • :yajl
  • :nsjsonserialization (MacRuby only)
  • :gson (JRuby only)
  • :jr_jackson (JRuby only)

Executes passed block using specified adapter.

with_engine(new_adapter)

Alias for with_adapter

[Validate]