Module: OAuth::Optional — Documentation by YARD 0.9.44

# Module: OAuth::Optional

Defined in:
  lib/oauth/optional.rb

## Overview

Helpers for optional, lazily loaded integrations.

## Class Method Summary collapse

- .em_http_available? ⇒ Boolean

  Try to load EventMachine HTTP client support provided by em-http-request.

## Class Method Details

### .em_http_available? ⇒ `Boolean`

Try to load EventMachine HTTP client support provided by em-http-request.

Returns true if available, false if the dependency is not installed.
Never raises LoadError.

Returns:

- (`Boolean`)

    11
    12
    13
    14
    15
    16
    17
    # File 'lib/oauth/optional.rb', line 11

    def em_http_available?
      # em-http-request provides "em-http" entrypoint
      require "em-http"
      true
    rescue LoadError
      false
    end