Module: Faraday::AutoloadHelper

Included in:
Faraday, Adapter, Response
Defined in:
lib/faraday.rb

Instance Method Summary collapse

Instance Method Details

#autoload_all(prefix, options) ⇒ Object


3
4
5
6
7
# File 'lib/faraday.rb', line 3

def autoload_all(prefix, options)
  options.each do |const_name, path|
    autoload const_name, File.join(prefix, path)
  end
end

#loadObject

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


11
12
13
14
15
# File 'lib/faraday.rb', line 11

def load
  constants.each do |const|
    const_get(const) if autoload?(const)
  end
end