Module: Faraday::AutoloadHelper
Instance Method Summary collapse
- #autoload_all(prefix, options) ⇒ Object
-
#load ⇒ Object
Loads each autoloaded constant.
Instance Method Details
#autoload_all(prefix, options) ⇒ Object
3 4 5 6 7 |
# File 'lib/faraday.rb', line 3 def autoload_all(prefix, ) .each do |const_name, path| autoload const_name, File.join(prefix, path) end end |
#load ⇒ Object
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 |