vendor/bundle/ruby/1.8/gems/multi_json-1.3.2/lib/multi_json.rb
def default_adapter
    return :oj if defined?(::Oj)
    return :yajl if defined?(::Yajl)
    return :json_gem if defined?(::JSON)

    REQUIREMENT_MAP.each do |(library, adapter)|
      begin
        require library
        return adapter
      rescue LoadError
        next
      end
    end

    Kernel.warn "[WARNING] MultiJson is using the default adapter (ok_json). We recommend loading a different JSON library to improve performance."
    :ok_json
  end
# 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.
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.
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 .
def default_adapter
    return :oj if defined?(::Oj)
    return :yajl if defined?(::Yajl)
    return :json_gem if defined?(::JSON)
    REQUIREMENT_MAP.each do |(library, adapter)|
      begin
        require library
        return adapter
      rescue LoadError
        next
      end
    end
    Kernel.warn "[WARNING] MultiJson is using the default adapter (ok_json). We recommend loading a different JSON library to improve performance."
    :ok_json
  end
def default_adapter return :oj if defined? ( :: Oj ) return :yajl if defined? ( :: Yajl ) return :json_gem if defined? ( :: JSON ) REQUIREMENT_MAP . each do | ( library , adapter ) | begin require library return adapter rescue LoadError next end end Kernel . warn "[WARNING] MultiJson is using the default adapter (ok_json). We recommend loading a different JSON library to improve performance." :ok_json end
The default adapter based on what you currently
have loaded and installed.
The default adapter based on what you currently have loaded and installed .