vendor/bundle/ruby/2.5.0/gems/faraday-0.15.4/lib/faraday.rb
# Public: Register middleware class(es) on the current module.
#
# 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
#
#   module Faraday
#     class Whatever
#       # Middleware looked up by :foo returns Faraday::Whatever::Foo.
#       register_middleware :foo => Foo
#
#       # Middleware looked up by :bar returns Faraday::Whatever.const_get(:Bar)
#       register_middleware :bar => :Bar
#
#       # Middleware looked up by :baz requires 'baz' and returns Faraday::Whatever.const_get(:Baz)
#       register_middleware :baz => [:Baz, 'baz']
#     end
#   end
#
# Returns nothing.
Register middleware class(es) on the current module.
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







Returns nothing.
Register middleware class ( es ) on the current module . 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 Returns nothing .
def register_middleware(autoload_path = nil, mapping = nil)
      if mapping.nil?
        mapping = autoload_path
        autoload_path = nil
      end
      middleware_mutex do
        @middleware_autoload_path = autoload_path if autoload_path
        (@registered_middleware ||= {}).update(mapping)
      end
    end
def register_middleware ( autoload_path = nil , mapping = nil ) if mapping . nil? mapping = autoload_path autoload_path = nil end middleware_mutex do @middleware_autoload_path = autoload_path if autoload_path ( @registered_middleware ||= { } ) . update ( mapping ) end end
Public: Register middleware class(es) on the current module.
Public : Register middleware class ( es ) on the current module .
autoload_path
<not_specific>
mapping
<not_specific>