Class: ActiveRestClient::FaradayResponseProxy

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

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

#bodyObject



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

Returns:

  • (Boolean)


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

def finished?
  true
end

#headersObject



155
156
157
# File 'lib/active_rest_client/proxy_base.rb', line 155

def headers
  @response.response_headers
end

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

Yields:

  • (@response)


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

def on_complete
  yield(@response)
end

#statusObject



159
160
161
# File 'lib/active_rest_client/proxy_base.rb', line 159

def status
  @response.status
end