Class: Flexirest::FaradayResponseProxy

Inherits:
Object
  • Object
show all
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

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

#bodyObject



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

Returns:

  • (Boolean)


223
224
225
# File 'lib/flexirest/proxy_base.rb', line 223

def finished?
  true
end

#headersObject



202
203
204
# File 'lib/flexirest/proxy_base.rb', line 202

def headers
  @response.response_headers
end

#on_complete {|@response| ... } ⇒ Object

Yields:

  • (@response)


219
220
221
# File 'lib/flexirest/proxy_base.rb', line 219

def on_complete
  yield(@response)
end

#statusObject



206
207
208
# File 'lib/flexirest/proxy_base.rb', line 206

def status
  @response.status
end