# File lib/faraday.rb, line 32 def self.default_connection @default_connection ||= Connection.new end
# File lib/faraday.rb, line 9 def new(url = nil, options = {}) block = block_given? ? Proc.new : nil Faraday::Connection.new(url, options, &block) end
Public: register middleware classes under a short name.
type - A Symbol specifying the kind of middleware (default: :middleware) mapping - A Hash mapping Symbol keys to classes. Classes can be expressed
as fully qualified constant, or a Proc that will be lazily called to return the former.
Examples
Faraday.register_middleware :aloha => MyModule::Aloha Faraday.register_middleware :response, :boom => MyModule::Boom # shortcuts are now available in Builder: builder.use :aloha builder.response :boom
Returns nothing.
# File lib/faraday.rb, line 109 def self.register_middleware type, mapping = nil type, mapping = :middleware, type if mapping.nil? component = self.const_get(type.to_s.capitalize) component.register_middleware(mapping) end
# File lib/faraday.rb, line 14 def require_libs(*libs) libs.each do |lib| require "#{lib_path}/#{lib}" end end
Generated with the Darkfish Rdoc Generator 2.