module Faraday::AutoloadHelper
def all_loaded_constants
def all_loaded_constants constants.map { |c| const_get(c) }. select { |a| a.respond_to?(:loaded?) && a.loaded? } end
def autoload_all(prefix, options)
def autoload_all(prefix, options) options.each do |const_name, path| autoload const_name, File.join(prefix, path) end end
def load_autoloaded_constants
Loads each autoloaded constant. If thread safety is a concern, wrap
def load_autoloaded_constants constants.each do |const| const_get(const) if autoload?(const) end end
def lookup_module(key)
def lookup_module(key) return if !@lookup_module_index const_get @lookup_module_index[key] || key end
def register_lookup_modules(mods)
def register_lookup_modules(mods) (@lookup_module_index ||= {}).update(mods) end