Class: EzClient
- Inherits:
-
Object
- Object
- EzClient
- Defined in:
- lib/ezclient.rb,
lib/ezclient/version.rb
Defined Under Namespace
Constant Summary collapse
- VERSION =
"0.4.0"
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ EzClient
constructor
A new instance of EzClient.
- #request(verb, url, **options) ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ EzClient
Returns a new instance of EzClient.
9 10 11 12 |
# File 'lib/ezclient.rb', line 9 def initialize( = {}) self. = self.clients = {} end |
Instance Method Details
#request(verb, url, **options) ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/ezclient.rb', line 14 def request(verb, url, **) keep_alive_timeout = .delete(:keep_alive) if keep_alive_timeout client = persistent_client_for(url, timeout: keep_alive_timeout) else client = HTTP::Client.new end Request.new(verb, url, client: client, **, **) end |