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.



164
165
166
# File 'lib/active_rest_client/proxy_base.rb', line 164

def initialize(response)
  @response = response
end

Instance Method Details

#bodyObject



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

def body
  @response.body
end

#body=(value) ⇒ Object



180
181
182
183
# File 'lib/active_rest_client/proxy_base.rb', line 180

def body=(value)
  @response.body = value
  value
end

#finished?Boolean

Returns:

  • (Boolean)


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

def finished?
  true
end

#headersObject



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

def headers
  @response.response_headers
end

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

Yields:

  • (@response)


185
186
187
# File 'lib/active_rest_client/proxy_base.rb', line 185

def on_complete
  yield(@response)
end

#statusObject



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

def status
  @response.status
end