Class: Faraday::RackBuilder::Handler
- Inherits:
-
Object
- Object
- Faraday::RackBuilder::Handler
- Defined in:
- lib/faraday/rack_builder.rb
Overview
borrowed from ActiveSupport::Dependencies::Reference & ActionDispatch::MiddlewareStack::Middleware
Constant Summary collapse
- REGISTRY =
Faraday::AdapterRegistry.new
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
28 29 30 |
# File 'lib/faraday/rack_builder.rb', line 28 def name @name end |
Instance Method Details
#==(other) ⇒ Object
45 46 47 48 49 50 51 52 53 |
# 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 |
#build(app = nil) ⇒ Object
55 56 57 |
# File 'lib/faraday/rack_builder.rb', line 55 def build(app = nil) klass.new(app, *@args, &@block) end |
#inspect ⇒ Object
41 42 43 |
# File 'lib/faraday/rack_builder.rb', line 41 def inspect @name end |
#klass ⇒ Object
37 38 39 |
# File 'lib/faraday/rack_builder.rb', line 37 def klass REGISTRY.get(@name) end |