class Async::REST::Wrapper::Generic

Public Instance Methods

parser_for(response) click to toggle source
# 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) click to toggle source

@param payload [Object] a request payload to send. @param headers [Protocol::HTTP::Headers] the mutable HTTP headers for the request. @return [Body | nil] an optional request body based on the given payload.

# File lib/async/rest/wrapper/generic.rb, line 30
def prepare_request(payload, headers)
end
process_response(request, response) click to toggle source

@param request [Protocol::HTTP::Request] the request that was made. @param response [Protocol::HTTP::Response] the response that was received. @return [Object] some application specific representation of the response.

# File lib/async/rest/wrapper/generic.rb, line 36
def process_response(request, response)
        wrap_response(response)
end
wrap_response(response) click to toggle source

Wrap the response body in the given klass.

# 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