Class: Faraday::Middleware

### Home Classes Methods

### In Files

- lib/faraday/middleware.rb

### Parent

Object

### Methods

- ::dependency
- ::inherited
- ::loaded?
- ::new
- ::new

### Class/Module Index

Quicksearch

- Faraday
- Faraday::Adapter
- Faraday::Adapter::EMHttp
- Faraday::Adapter::EMHttp::Manager
- Faraday::Adapter::EMHttp::Options
- Faraday::Adapter::EMSynchrony
- Faraday::Adapter::EMSynchrony::ParallelManager
- Faraday::Adapter::Excon
- Faraday::Adapter::NetHttp
- Faraday::Adapter::NetHttpPersistent
- Faraday::Adapter::Parallelism
- Faraday::Adapter::Patron
- Faraday::Adapter::Rack
- Faraday::Adapter::Test
- Faraday::Adapter::Test::Stub
- Faraday::Adapter::Test::Stubs
- Faraday::Adapter::Test::Stubs::NotFound
- Faraday::Adapter::Typhoeus
- Faraday::AutoloadHelper
- Faraday::Builder
- Faraday::Builder::Handler
- Faraday::Builder::StackLocked
- Faraday::CompositeReadIO
- Faraday::Connection
- Faraday::Error
- Faraday::Error::ClientError
- Faraday::Error::ConnectionFailed
- Faraday::Error::MissingDependency
- Faraday::Error::ParsingError
- Faraday::Error::ResourceNotFound
- Faraday::Error::TimeoutError
- Faraday::Middleware
- Faraday::MiddlewareRegistry
- Faraday::Request
- Faraday::Request::Authorization
- Faraday::Request::BasicAuthentication
- Faraday::Request::Multipart
- Faraday::Request::Retry
- Faraday::Request::TokenAuthentication
- Faraday::Request::UrlEncoded
- Faraday::Response
- Faraday::Response::Logger
- Faraday::Response::Middleware
- Faraday::Response::RaiseError
- Faraday::Utils
- Faraday::Utils::Headers
- Faraday::Utils::ParamsHash
- Object

No matching classes.

# Faraday::Middleware

### Attributes

load_error[RW]

### Public Class Methods

dependency(lib = nil) click to toggle source

Executes a block which should try to require and reference dependent libraries

    # File lib/faraday/middleware.rb, line 13
    def self.dependency(lib = nil)
      lib ? require(lib) : yield
    rescue LoadError, NameError => error
      self.load_error = error
    end

inherited(subclass) click to toggle source

    # File lib/faraday/middleware.rb, line 28
    def self.inherited(subclass)
      super
      subclass.send(:load_error=, self.load_error)
    end

loaded?() click to toggle source

    # File lib/faraday/middleware.rb, line 24
    def self.loaded?
      load_error.nil?
    end

new(*) click to toggle source

    # File lib/faraday/middleware.rb, line 19
    def self.new(*)
      raise "missing dependency for #{self}: #{load_error.message}" unless loaded?
      super
    end

new(app = nil) click to toggle source

    # File lib/faraday/middleware.rb, line 33
    def initialize(app = nil)
      @app = app
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.