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 ⇒ 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.
266 267 268 |
# File 'lib/httpx/plugins/retries.rb', line 266 def partial_response=(value) @partial_response = value end |
#retries ⇒ Integer
number of retries left.
263 264 265 |
# File 'lib/httpx/plugins/retries.rb', line 263 def retries @retries end |
Instance Method Details
#initialize ⇒ Object
initializes the request instance, sets the number of retries for the request.
269 270 271 272 273 |
# File 'lib/httpx/plugins/retries.rb', line 269 def initialize(*) super @retries = @options.max_retries @partial_response = nil end |
#response=(response) ⇒ void
This method returns an undefined value.
275 276 277 278 279 280 281 282 283 284 285 286 |
# File 'lib/httpx/plugins/retries.rb', line 275 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 |