vendor/bundle/ruby/2.7.0/gems/faraday-1.3.0/lib/faraday/autoload.rb
# Registers the constants to be auto loaded.
#
# @param prefix [String] The require prefix. If the path is inside Faraday,
#           then it will be prefixed with the root path of this loaded
#           Faraday version.
# @param options [{ Symbol => String }] library names.
#
# @example
#
#   Faraday.autoload_all 'faraday/foo',
#     Bar: 'bar'
#
#   # requires faraday/foo/bar to load Faraday::Bar.
#   Faraday::Bar
#
# @return [void]
Registers the constants to be auto loaded.
Registers the constants to be auto loaded .
def autoload_all(prefix, options)
      if prefix.match? %r{^faraday(/|$)}i
        prefix = File.join(Faraday.root_path, prefix)
      end
      options.each do |const_name, path|
        autoload const_name, File.join(prefix, path)
      end
    end
def autoload_all ( prefix , options ) if prefix . match? %r{ ^faraday(/|$) }i prefix = File . join ( Faraday . root_path , prefix ) end options . each do | const_name , path | autoload const_name , File . join ( prefix , path ) end end
Registers the constants to be auto loaded.
Registers the constants to be auto loaded .
None
void
prefix
The require prefix. If the path is inside Faraday, then it will be prefixed with the root path of this loaded Faraday version.
The require prefix . If the path is inside Faraday then it will be prefixed with the root path of this loaded Faraday version .
options
None
example
Faraday.autoload_all 'faraday/foo', Bar: 'bar' # requires faraday/foo/bar to load Faraday::Bar. Faraday::Bar
Faraday . autoload_all ' faraday / foo ' Bar : ' bar ' # requires faraday / foo / bar to load Faraday :: Bar . Faraday :: Bar