Module: Faraday::AutoloadHelper

### Home Classes Methods

### In Files

- lib/faraday/autoload.rb

### Methods

- #all_loaded_constants
- #autoload_all
- #load_autoloaded_constants

### 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::HTTPClient
- 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::ClientError
- Faraday::CompositeReadIO
- Faraday::Connection
- Faraday::ConnectionFailed
- Faraday::ConnectionOptions
- Faraday::Env
- Faraday::Error
- Faraday::FlatParamsEncoder
- Faraday::Middleware
- Faraday::MiddlewareRegistry
- Faraday::MissingDependency
- Faraday::NestedParamsEncoder
- Faraday::Options
- Faraday::ParsingError
- Faraday::ProxyOptions
- Faraday::RackBuilder
- Faraday::RackBuilder::Handler
- Faraday::RackBuilder::StackLocked
- Faraday::Request
- Faraday::Request::Authorization
- Faraday::Request::BasicAuthentication
- Faraday::Request::Instrumentation
- Faraday::Request::Instrumentation::Options
- Faraday::Request::Multipart
- Faraday::Request::Retry
- Faraday::Request::Retry::Options
- Faraday::Request::TokenAuthentication
- Faraday::Request::UrlEncoded
- Faraday::RequestOptions
- Faraday::ResourceNotFound
- Faraday::Response
- Faraday::Response::Logger
- Faraday::Response::Middleware
- Faraday::Response::RaiseError
- Faraday::SSLError
- Faraday::SSLOptions
- Faraday::TimeoutError
- Faraday::Utils
- Faraday::Utils::Headers
- Faraday::Utils::ParamsHash
- EmHttpSslPatch
- Object

No matching classes.

# Faraday::AutoloadHelper

Internal: Adds the ability for other modules to manage autoloadable constants.

### Public Instance Methods

all_loaded_constants() click to toggle source

Internal: Filters the module's contents with those that have been already autoloaded.

Returns an Array of Class/Module objects.

    # File lib/faraday/autoload.rb, line 45
    def all_loaded_constants
      constants.map { |c| const_get(c) }.
        select { |a| a.respond_to?(:loaded?) && a.loaded? }
    end

autoload_all(prefix, options) click to toggle source

Internal: Registers the constants to be auto loaded.

prefix - The String require prefix. If the path is inside Faraday, then

    it will be prefixed with the root path of this loaded Faraday
    version.

options - Hash of Symbol => String library names.

Examples.

    Faraday.autoload_all 'faraday/foo',
      :Bar => 'bar'

    # requires faraday/foo/bar to load Faraday::Bar.
    Faraday::Bar

Returns nothing.

    # File lib/faraday/autoload.rb, line 22
    def autoload_all(prefix, options)
      if prefix =~ /^faraday(\/|$)/
        prefix = File.join(Faraday.root_path, prefix)
      end
      options.each do |const_name, path|
        autoload const_name, File.join(prefix, path)
      end
    end

load_autoloaded_constants() click to toggle source

Internal: Loads each autoloaded constant. If thread safety is a concern, wrap this in a Mutex.

Returns nothing.

    # File lib/faraday/autoload.rb, line 35
    def load_autoloaded_constants
      constants.each do |const|
        const_get(const) if autoload?(const)
      end
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.