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

Methods

Classes and Modules

Module MultiJson::Adapters
Module MultiJson::OkJson
Class MultiJson::LoadError

Constants

VERSION = "1.6.1" unless defined?(MultiJson::VERSION)
DecodeError = LoadError # Legacy support
REQUIREMENT_MAP = [ ['oj', :oj], ['yajl', :yajl], ['json', :json_gem], ['gson', :gson], ['json/pure', :json_pure]

Attributes

default_options  [RW] 

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 engine will be used just for the 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)

Executes passed block using specified adapter.

with_engine(new_adapter)

Alias for with_adapter

[Validate]