Class: MultiJson::Adapter

Inherits:
Object
  • Object
show all
Extended by:
Options
Includes:
Singleton
Defined in:
lib/multi_json/adapter.rb

Class Method Summary collapse

Methods included from Options

default_dump_options, default_load_options, dump_options, dump_options=, load_options, load_options=

Class Method Details

.defaults(action, value) ⇒ Object


10
11
12
13
14
15
16
# 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 = {}) ⇒ Object


22
23
24
# File 'lib/multi_json/adapter.rb', line 22

def dump(object, options={})
  instance.dump(object, collect_dump_options(options).clone)
end

.load(string, options = {}) ⇒ Object


18
19
20
# File 'lib/multi_json/adapter.rb', line 18

def load(string, options={})
  instance.load(string, collect_load_options(options).clone)
end