Class: Flexirest::FaradayResponseProxy
- Inherits:
-
Object
- Object
- Flexirest::FaradayResponseProxy
- Defined in:
- lib/flexirest/proxy_base.rb
Overview
FaradayResponseProxy acts just like a Faraday Response object, however it always resolves the request immediately regardless of whether it is inside an in_parallel block or not
Instance Method Summary collapse
- #body ⇒ Object
- #body=(value) ⇒ Object
- #finished? ⇒ Boolean
- #headers ⇒ Object
-
#initialize(response) ⇒ FaradayResponseProxy
constructor
A new instance of FaradayResponseProxy.
- #on_complete {|@response| ... } ⇒ Object
- #status ⇒ Object
Constructor Details
#initialize(response) ⇒ FaradayResponseProxy
Returns a new instance of FaradayResponseProxy.
198 199 200 |
# File 'lib/flexirest/proxy_base.rb', line 198 def initialize(response) @response = response end |
Instance Method Details
#body ⇒ Object
210 211 212 |
# File 'lib/flexirest/proxy_base.rb', line 210 def body @response.body end |
#body=(value) ⇒ Object
214 215 216 217 |
# File 'lib/flexirest/proxy_base.rb', line 214 def body=(value) @response.body = value value end |
#finished? ⇒ Boolean
223 224 225 |
# File 'lib/flexirest/proxy_base.rb', line 223 def finished? true end |
#headers ⇒ Object
202 203 204 |
# File 'lib/flexirest/proxy_base.rb', line 202 def headers @response.response_headers end |
#on_complete {|@response| ... } ⇒ Object
219 220 221 |
# File 'lib/flexirest/proxy_base.rb', line 219 def on_complete yield(@response) end |
#status ⇒ Object
206 207 208 |
# File 'lib/flexirest/proxy_base.rb', line 206 def status @response.status end |