This class respresents the response.
Set the handled response.
@api private
The options provided, contains all the informations about the request.
@return [ Hash ]
Remembers the corresponding request.
@example Get request.
request = Typhoeus::Request.get("www.example.com") response = request.run request == response.request #=> true
@return [ Typhoeus::Request ]
Create a new response.
@example Create a response.
Response.new
@param [ Hash ] options The options hash.
@return [ Response ] The new response.
# File lib/typhoeus/response.rb, line 43 def initialize(options = {}) @options = options @headers = Header.new(options[:headers]) if options[:headers] end
Returns the #handled_response if it has been defined otherwise returns the response
@return [ Object ] The result of callbacks
done on the response or the original response.
# File lib/typhoeus/response.rb, line 61 def handled_response @handled_response || self end
Returns wether this request is mocked or not.
@api private
# File lib/typhoeus/response.rb, line 52 def mock defined?(@mock) ? @mock : options[:mock] end