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.
168 169 170 |
# File 'lib/flexirest/proxy_base.rb', line 168 def initialize(response) @response = response end |
Instance Method Details
#body ⇒ Object
180 181 182 |
# File 'lib/flexirest/proxy_base.rb', line 180 def body @response.body end |
#body=(value) ⇒ Object
184 185 186 187 |
# File 'lib/flexirest/proxy_base.rb', line 184 def body=(value) @response.body = value value end |
#finished? ⇒ Boolean
193 194 195 |
# File 'lib/flexirest/proxy_base.rb', line 193 def finished? true end |
#headers ⇒ Object
172 173 174 |
# File 'lib/flexirest/proxy_base.rb', line 172 def headers @response.response_headers end |
#on_complete {|@response| ... } ⇒ Object
189 190 191 |
# File 'lib/flexirest/proxy_base.rb', line 189 def on_complete yield(@response) end |
#status ⇒ Object
176 177 178 |
# File 'lib/flexirest/proxy_base.rb', line 176 def status @response.status end |