class Faraday::RackBuilder::Handler

borrowed from ActiveSupport::Dependencies::Reference & ActionDispatch::MiddlewareStack::Middleware

Constants

REGISTRY

Attributes

Public Class Methods

# File lib/faraday/rack_builder.rb, line 30
               def initialize(klass, *args, &block)
  @name = klass.to_s
  REGISTRY.set(klass) if klass.respond_to?(:name)
  @args = args
  @block = block
end

Public Instance Methods

# File lib/faraday/rack_builder.rb, line 45
def ==(other)
  if other.is_a? Handler
    name == other.name
  elsif other.respond_to? :name
    klass == other
  else
    @name == other.to_s
  end
end
# File lib/faraday/rack_builder.rb, line 55
def build(app = nil)
  klass.new(app, *@args, &@block)
end
# File lib/faraday/rack_builder.rb, line 41
def inspect
  @name
end
# File lib/faraday/rack_builder.rb, line 37
def klass
  REGISTRY.get(@name)
end