borrowed from ActiveSupport::Dependencies::Reference & ActionDispatch::MiddlewareStack::Middleware
# File lib/faraday/builder.rb, line 23 def initialize(klass, *args, &block) @name = klass.to_s @@constants[@name] = klass if klass.respond_to?(:name) @args, @block = args, block end
# File lib/faraday/builder.rb, line 32 def ==(other) if other.is_a? Handler self.name == other.name elsif other.respond_to? :name klass == other else @name == other.to_s end end
# File lib/faraday/builder.rb, line 42 def build(app) klass.new(app, *@args, &@block) end
# File lib/faraday/builder.rb, line 30 def inspect() @name end
# File lib/faraday/builder.rb, line 29 def klass() @@constants[@name] end