Class: Loggie::Request
- Inherits:
-
Object
- Object
- Loggie::Request
- Includes:
- Logging
- Defined in:
- lib/loggie/request.rb
Overview
Makes external HTTP request, with a retry mechanism for polling long running queries on remote server
Instance Method Summary collapse
- #call(url, method: :get, options: nil) ⇒ Object
-
#initialize(retry_mechanism:) ⇒ Request
constructor
A new instance of Request.
Methods included from Logging
included, logger, #logger, logger=
Constructor Details
#initialize(retry_mechanism:) ⇒ Request
10 11 12 |
# File 'lib/loggie/request.rb', line 10 def initialize(retry_mechanism: ) @retry_mechanism = retry_mechanism || Retry.new end |
Instance Method Details
#call(url, method: :get, options: nil) ⇒ Object
14 15 16 17 18 |
# File 'lib/loggie/request.rb', line 14 def call(url, method: :get, options: nil) retry_mechanism.call(url, method, ) do |url, method, | request(url, method: method, options: ) end end |