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.
54 55 56 |
# File 'sig/plugins/retries.rbs', line 54 def @options end |
#partial_response=(value) ⇒ Object (writeonly)
a response partially received before.
249 250 251 |
# File 'lib/httpx/plugins/retries.rb', line 249 def partial_response=(value) @partial_response = value end |
#retries ⇒ Integer
number of retries left.
246 247 248 |
# File 'lib/httpx/plugins/retries.rb', line 246 def retries @retries end |
Instance Method Details
#initialize(*args) ⇒ Object
initializes the request instance, sets the number of retries for the request.
252 253 254 255 256 |
# File 'lib/httpx/plugins/retries.rb', line 252 def initialize(*args) super @retries = @options.max_retries @partial_response = nil end |
#response=(response) ⇒ void
This method returns an undefined value.
258 259 260 261 262 263 264 265 266 267 268 269 |
# File 'lib/httpx/plugins/retries.rb', line 258 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 |