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.



168
169
170
# File 'lib/flexirest/proxy_base.rb', line 168

def initialize(response)
  @response = response
end

Instance Method Details

#bodyObject



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

Returns:

  • (Boolean)


193
194
195
# File 'lib/flexirest/proxy_base.rb', line 193

def finished?
  true
end

#headersObject



172
173
174
# File 'lib/flexirest/proxy_base.rb', line 172

def headers
  @response.response_headers
end

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

Yields:

  • (@response)


189
190
191
# File 'lib/flexirest/proxy_base.rb', line 189

def on_complete
  yield(@response)
end

#statusObject



176
177
178
# File 'lib/flexirest/proxy_base.rb', line 176

def status
  @response.status
end