lib/htty/session.rb
# Walks #requests and returns its last HTTY::Response.
Walks #requests and returns its last HTTY::Response.
Walks #requests and returns its last HTTY :: Response .
def last_response
    last_request_with_response = requests.reverse.detect do |r|
      r.response
    end
    return nil unless last_request_with_response
    last_request_with_response.response
  end
def last_response last_request_with_response = requests . reverse . detect do | r | r . response end return nil unless last_request_with_response last_request_with_response . response end
Walks #requests and returns its last HTTY::Response.
Walks #requests and returns its last HTTY :: Response .