class RSolr::Client
def adapt_response request, response
if :wt == :ruby and the body
+adapt_response+ will raise an InvalidRubyResponse
request and response from the connection.
These methods give you access to the original
The return object has methods attached, :request and :response.
... otherwise, the body is returned as is.
if the params[:uri].params[:wt] == :ruby
This method will evaluate the :body value
def adapt_response request, response raise "The response does not have the correct keys => :body, :headers, :status" unless %W(body headers status) == response.keys.map{|k|k.to_s}.sort raise RSolr::Error::Http.new request, response unless [200,302].include? response[:status] result = request[:params][:wt] == :ruby ? evaluate_ruby_response(request, response) : response[:body] result.extend Context result.request = request result.response = response result end