Module: HTTPX::Plugins::Retries::RequestMethods
- Defined in:
- lib/httpx/plugins/retries.rb,
sig/plugins/retries.rbs
Instance Attribute Summary collapse
-
#options ⇒ retriesOptions
readonly
Returns the value of attribute options.
-
#partial_response ⇒ Object
writeonly
a response partially received before.
-
#retries ⇒ Integer
number of retries left.
Instance Method Summary collapse
-
#initialize(*args) ⇒ Object
initializes the request instance, sets the number of retries for the request.
- #response=(response) ⇒ void
Instance Attribute Details
#options ⇒ retriesOptions (readonly)
Returns the value of attribute options.
56 57 58 |
# File 'sig/plugins/retries.rbs', line 56 def @options end |
#partial_response=(value) ⇒ Object (writeonly)
a response partially received before.
256 257 258 |
# File 'lib/httpx/plugins/retries.rb', line 256 def partial_response=(value) @partial_response = value end |
#retries ⇒ Integer
number of retries left.
253 254 255 |
# File 'lib/httpx/plugins/retries.rb', line 253 def retries @retries end |
Instance Method Details
#initialize(*args) ⇒ Object
initializes the request instance, sets the number of retries for the request.
259 260 261 262 263 |
# File 'lib/httpx/plugins/retries.rb', line 259 def initialize(*args) super @retries = @options.max_retries @partial_response = nil end |
#response=(response) ⇒ void
This method returns an undefined value.
265 266 267 268 269 270 271 272 273 274 275 276 |
# File 'lib/httpx/plugins/retries.rb', line 265 def response=(response) if (partial_response = @partial_response) if response.is_a?(Response) && response.status == 206 response.from_partial_response(partial_response) else partial_response.close end @partial_response = nil end super end |