Class: ActiveRestClient::FaradayResponseProxy
- Inherits:
-
Object
- Object
- ActiveRestClient::FaradayResponseProxy
- Defined in:
- lib/active_rest_client/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.
151 152 153 |
# File 'lib/active_rest_client/proxy_base.rb', line 151 def initialize(response) @response = response end |
Instance Method Details
#body ⇒ Object
163 164 165 |
# File 'lib/active_rest_client/proxy_base.rb', line 163 def body @response.body end |
#body=(value) ⇒ Object
167 168 169 170 |
# File 'lib/active_rest_client/proxy_base.rb', line 167 def body=(value) @response.body = value value end |
#finished? ⇒ Boolean
176 177 178 |
# File 'lib/active_rest_client/proxy_base.rb', line 176 def finished? true end |
#headers ⇒ Object
155 156 157 |
# File 'lib/active_rest_client/proxy_base.rb', line 155 def headers @response.response_headers end |
#on_complete {|@response| ... } ⇒ Object
172 173 174 |
# File 'lib/active_rest_client/proxy_base.rb', line 172 def on_complete yield(@response) end |
#status ⇒ Object
159 160 161 |
# File 'lib/active_rest_client/proxy_base.rb', line 159 def status @response.status end |