Class: HTTPI::Adapter::Base
- Inherits:
-
Object
- Object
- HTTPI::Adapter::Base
- Defined in:
- lib/httpi/adapter/base.rb
Overview
HTTPI::Adapter::Base
Allows you to build your own adapter by implementing all public instance methods. Register your adapter by calling the base class’ .register method.
Direct Known Subclasses
Curb, EmHttpRequest, Excon, HTTP, HTTPClient, NetHTTP, Rack
Class Method Summary collapse
-
.register(name, options = {}) ⇒ Object
Registers an adapter.
Instance Method Summary collapse
-
#client ⇒ Object
Returns a client instance.
-
#initialize(request) ⇒ Base
constructor
A new instance of Base.
-
#request(method) ⇒ Object
Executes arbitrary HTTP requests.
Constructor Details
#initialize(request) ⇒ Base
Returns a new instance of Base.
18 19 |
# File 'lib/httpi/adapter/base.rb', line 18 def initialize(request) end |
Class Method Details
Instance Method Details
#client ⇒ Object
Returns a client instance.
22 23 24 |
# File 'lib/httpi/adapter/base.rb', line 22 def client raise NotImplementedError, "Adapters need to implement a #client method" end |
#request(method) ⇒ Object
Executes arbitrary HTTP requests.
28 29 30 |
# File 'lib/httpi/adapter/base.rb', line 28 def request(method) raise NotImplementedError, "Adapters need to implement a #request method" end |