class MultiJson::Adapter - multi_json-1.10.1 Documentation

# class MultiJson::Adapter

### Public Instance 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 23
    def dump(object, options={})
      instance.dump(object, dump_options(options).merge(MultiJson.dump_options(options)).merge!(options))
    end

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

    # File lib/multi_json/adapter.rb, line 18
    def load(string, options={})
      raise self::ParseError if blank?(string)
      instance.load(string, load_options(options).merge(MultiJson.load_options(options)).merge!(options))
    end

### Private Instance Methods

blank?(input) click to toggle source

    # File lib/multi_json/adapter.rb, line 29
    def blank?(input)
      input.nil? || /\A\s*\z/ === input
    rescue ArgumentError # invalid byte sequence in UTF-8
      false
    end