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
38 39 40 |
# File 'lib/async/rest/wrapper/generic.rb', line 38 def parser_for(response) return Unsupported end |
#prepare_request(payload, headers) ⇒ Body | nil
Returns an optional request body based on the given payload.
28 29 |
# File 'lib/async/rest/wrapper/generic.rb', line 28 def prepare_request(payload, headers) end |
#process_response(request, response) ⇒ Object
Returns some application specific representation of the response.
34 35 36 |
# File 'lib/async/rest/wrapper/generic.rb', line 34 def process_response(request, response) wrap_response(response) end |
#wrap_response(response) ⇒ Object
Wrap the response body in the given klass.
43 44 45 46 47 48 49 |
# File 'lib/async/rest/wrapper/generic.rb', line 43 def wrap_response(response) if body = response.body response.body = parser_for(response).new(body) end return response end |