Module: Dagger
- Defined in:
- lib/dagger/connection_manager.rb,
lib/dagger/version.rb,
lib/dagger/wrapper.rb,
lib/dagger/response.rb,
lib/dagger.rb
Overview
unused (we’re using Net::HTTP::Persistent again)
Defined Under Namespace
Modules: Response, Utils, Wrapper
Classes: Client, ConnectionManager
Constant Summary
collapse
- MAJOR =
2
- MINOR =
3
- PATCH =
1
- VERSION =
[MAJOR, MINOR, PATCH].join('.')
- DAGGER_NAME =
"Dagger/#{VERSION}".freeze
- REDIRECT_CODES =
[301, 302, 303].freeze
- DEFAULT_RETRY_WAIT =
5.freeze
{
'Accept' => '*/*',
'User-Agent' => "#{DAGGER_NAME} (Ruby Net::HTTP wrapper, like curl)"
}.freeze
- DEFAULTS =
{
open_timeout: 10,
read_timeout: 10,
keep_alive_timeout: 10
}.freeze
Class Method Summary
collapse
-
.delete(uri, data, options = {}) ⇒ Object
-
.get(uri, options = {}) ⇒ Object
-
.open(uri, opts = {}, &block) ⇒ Object
-
.patch(uri, data, options = {}) ⇒ Object
-
.post(uri, data, options = {}) ⇒ Object
-
.put(uri, data, options = {}) ⇒ Object
-
.request(method, url, data = {}, options = {}) ⇒ Object
Class Method Details
.delete(uri, data, options = {}) ⇒ Object
307
308
309
|
# File 'lib/dagger.rb', line 307
def delete(uri, data, options = {})
request(:delete, uri, data, options)
end
|
.get(uri, options = {}) ⇒ Object
291
292
293
|
# File 'lib/dagger.rb', line 291
def get(uri, options = {})
request(:get, uri, nil, options)
end
|
.open(uri, opts = {}, &block) ⇒ Object
282
283
284
285
286
287
288
289
|
# File 'lib/dagger.rb', line 282
def open(uri, opts = {}, &block)
client = Client.init(uri, opts.merge(persistent: true))
if block_given?
client.open(&block)
client.close
end
client
end
|
.patch(uri, data, options = {}) ⇒ Object
303
304
305
|
# File 'lib/dagger.rb', line 303
def patch(uri, data, options = {})
request(:patch, uri, data, options)
end
|
.post(uri, data, options = {}) ⇒ Object
295
296
297
|
# File 'lib/dagger.rb', line 295
def post(uri, data, options = {})
request(:post, uri, data, options)
end
|
.put(uri, data, options = {}) ⇒ Object
299
300
301
|
# File 'lib/dagger.rb', line 299
def put(uri, data, options = {})
request(:put, uri, data, options)
end
|
.request(method, url, data = {}, options = {}) ⇒ Object
311
312
313
|
# File 'lib/dagger.rb', line 311
def request(method, url, data = {}, options = {})
Client.init(url, options).request(method, url, data, options)
end
|