Class: MultiJson::Adapter

### Home Classes Methods

### In Files

- lib/multi_json/adapter.rb

### Parent

Object

### Methods

- ::collect_dump_options
- ::collect_load_options
- ::collect_options
- ::defaults
- ::dump
- ::load

### Included Modules

- Singleton

### Class/Module Index

Quicksearch

- MultiJson
- MultiJson::Adapter
- MultiJson::Adapters
- MultiJson::Adapters::Gson
- MultiJson::Adapters::Jrjackson
- MultiJson::Adapters::JsonCommon
- MultiJson::Adapters::JsonGem
- MultiJson::Adapters::JsonPure
- MultiJson::Adapters::Nsjsonserialization
- MultiJson::Adapters::Oj
- MultiJson::Adapters::OkJson
- MultiJson::Adapters::Yajl
- MultiJson::ConvertibleHashKeys
- MultiJson::LoadError
- MultiJson::OkJson
- MultiJson::OkJson::Error
- MultiJson::OkJson::Utf8Error
- MultiJson::Options

No matching classes.

# MultiJson::Adapter

### Public Class Methods

defaults(action, value) click to toggle source

    # File lib/multi_json/adapter.rb, line 10
    def defaults(action, value)
      metaclass = class << self; self; end

      metaclass.instance_eval do
        define_method("default_#{action}_options"){ value }
      end
    end

dump(object, options={}) click to toggle source

    # File lib/multi_json/adapter.rb, line 22
    def dump(object, options={})
      instance.dump(object, collect_dump_options(object, options))
    end

load(string, options={}) click to toggle source

    # File lib/multi_json/adapter.rb, line 18
    def load(string, options={})
      instance.load(string, collect_load_options(string, options))
    end

### Protected Class Methods

collect_dump_options(object, options) click to toggle source

    # File lib/multi_json/adapter.rb, line 32
    def collect_dump_options(object, options)
      collect_options :dump_options, options, [ object, options ]
    end

collect_load_options(string, options) click to toggle source

    # File lib/multi_json/adapter.rb, line 28
    def collect_load_options(string, options)
      collect_options :load_options, options, [ string, options ]
    end

collect_options(method, overrides, args) click to toggle source

    # File lib/multi_json/adapter.rb, line 36
    def collect_options(method, overrides, args)
      global, local = *[MultiJson, self].map{ |r| r.send(method, *args) }
      local.merge(global).merge(overrides)
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.