class Typhoeus::Response

This class respresents the response.

Attributes

mock[W]

@api private

options[RW]

The options provided, contains all the informations about the request.

@return [ Hash ]

request[RW]

Remembers the corresponding request.

@example Get request.

request = Typhoeus::Request.get("www.example.com")
response = request.run
request == response.request
#=> true

@return [ Typhoeus::Request ]

Public Class Methods

new(options = {}) click to toggle source

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 40
def initialize(options = {})
  @options = options
  @headers = options[:headers]
end

Public Instance Methods

mock() click to toggle source

Returns wether this request is mocked or not.

@api private

# File lib/typhoeus/response.rb, line 49
def mock
  defined?(@mock) ? @mock : options[:mock]
end