module MultiJson::Options - multi_json-1.10.1 Documentation

# module MultiJson::Options

### Public Instance Methods

default_dump_options() click to toggle source

    # File lib/multi_json/options.rb, line 24
    def default_dump_options
      @default_dump_options ||= {}
    end

default_load_options() click to toggle source

    # File lib/multi_json/options.rb, line 20
    def default_load_options
      @default_load_options ||= {}
    end

dump_options(*args) click to toggle source

    # File lib/multi_json/options.rb, line 16
    def dump_options(*args)
      defined?(@dump_options) && get_options(@dump_options, *args) || default_dump_options
    end

dump_options=(options) click to toggle source

    # File lib/multi_json/options.rb, line 8
    def dump_options=(options)
      @dump_options = options
    end

load_options(*args) click to toggle source

    # File lib/multi_json/options.rb, line 12
    def load_options(*args)
      defined?(@load_options) && get_options(@load_options, *args) || default_load_options
    end

load_options=(options) click to toggle source

    # File lib/multi_json/options.rb, line 4
    def load_options=(options)
      @load_options = options
    end

### Private Instance Methods

get_options(options, *args) click to toggle source

    # File lib/multi_json/options.rb, line 30
    def get_options(options, *args)
      if options.respond_to?(:call) and options.arity
        options.arity == 0 ? options[] : options[*args]
      elsif Hash === options or options.respond_to?(:to_hash)
        options.to_hash
      end
    end