module Faraday::DependencyLoader
DependencyLoader
helps Faraday
adapters and middleware load dependencies.
Attributes
Public Instance Methods
Source
# File lib/faraday/dependency_loader.rb, line 10 def dependency(lib = nil) lib ? require(lib) : yield rescue LoadError, NameError => e self.load_error = e end
Executes a block which should try to require and reference dependent libraries
Source
# File lib/faraday/dependency_loader.rb, line 28 def inherited(subclass) super subclass.send(:load_error=, load_error) end
Calls superclass method
Source
# File lib/faraday/dependency_loader.rb, line 16 def new(*) unless loaded? raise "missing dependency for #{self}: #{load_error.message}" end super end
Calls superclass method