Class: Async::REST::Wrapper::Generic
- Inherits:
-
Object
- Object
- Async::REST::Wrapper::Generic
- Defined in:
- lib/async/rest/wrapper/generic.rb
Direct Known Subclasses
Defined Under Namespace
Classes: Unsupported
Instance Method Summary collapse
- #parser_for(response) ⇒ Object
-
#prepare_request(payload, headers) ⇒ Body | nil
An optional request body based on the given payload.
-
#process_response(request, response) ⇒ Object
Some application specific representation of the response.
-
#wrap_response(response) ⇒ Object
Wrap the response body in the given klass.
Instance Method Details
#parser_for(response) ⇒ Object
40 41 42 43 |
# File 'lib/async/rest/wrapper/generic.rb', line 40 def parser_for(response) # It's not always clear why this error is being thrown. return Unsupported end |
#prepare_request(payload, headers) ⇒ Body | nil
Returns an optional request body based on the given payload.
30 31 |
# File 'lib/async/rest/wrapper/generic.rb', line 30 def prepare_request(payload, headers) end |
#process_response(request, response) ⇒ Object
Returns some application specific representation of the response.
36 37 38 |
# File 'lib/async/rest/wrapper/generic.rb', line 36 def process_response(request, response) wrap_response(response) end |
#wrap_response(response) ⇒ Object
Wrap the response body in the given klass.
46 47 48 49 50 51 52 |
# File 'lib/async/rest/wrapper/generic.rb', line 46 def wrap_response(response) if body = response.body response.body = parser_for(response).new(body) end return response end |