Module: Typhoeus::Config

Extended by:
Config
Included in:
Config
Defined in:
lib/typhoeus/config.rb

Overview

The Typhoeus configuration used to set global options.

Examples:

Set the configuration options within a block.

Typhoeus.configure do |config|
  config.verbose = true
end

Set the configuration directly.

Typhoeus::Config.verbose = true

Since:

  • 0.5.0

Instance Attribute Summary collapse

Instance Attribute Details

#block_connectionBoolean

Defines whether the connection is blocked. Defaults to false. When set to true, only stubbed requests are allowed. A Errors::NoStub error is raised, when trying to do a real request. It’s possible to work around inside Typhoeus.with_connection.

Returns:

  • (Boolean)

See Also:

Since:

  • 0.5.0



29
30
31
# File 'lib/typhoeus/config.rb', line 29

def block_connection
  @block_connection
end

#cacheObject

Defines whether requests are cached.

Returns:

  • (Object)

See Also:

Since:

  • 0.5.0



69
70
71
# File 'lib/typhoeus/config.rb', line 69

def cache
  @cache
end

#connecttimeoutInteger, Float

Defines the default HTTP timeout for the connection phase in seconds See README for more details about timeouts

Returns:

  • (Integer, Float)

See Also:

Since:

  • 0.5.0



61
62
63
# File 'lib/typhoeus/config.rb', line 61

def connecttimeout
  @connecttimeout
end

#memoizeBoolean

Defines whether GET requests are memoized when using the Hydra.

Returns:

  • (Boolean)

See Also:

Since:

  • 0.5.0



37
38
39
# File 'lib/typhoeus/config.rb', line 37

def memoize
  @memoize
end

#proxyString

Defines wether to use a proxy server for every request.

Returns:

  • (String)

See Also:

  • Request#set_defaults

Since:

  • 0.5.0



83
84
85
# File 'lib/typhoeus/config.rb', line 83

def proxy
  @proxy
end

#timeoutInteger, Float

Defines the default HTTP timeout for the entire request in seconds See README for more details about timeouts

Returns:

  • (Integer, Float)

See Also:

Since:

  • 0.5.0



53
54
55
# File 'lib/typhoeus/config.rb', line 53

def timeout
  @timeout
end

#user_agentString

Defines whether to use a default user agent.

Returns:

  • (String)

See Also:

  • Request#set_defaults

Since:

  • 0.5.0



76
77
78
# File 'lib/typhoeus/config.rb', line 76

def user_agent
  @user_agent
end

#verboseBoolean

Defines whether curls debug output is shown. Unfortunately it prints to stderr.

Returns:

  • (Boolean)

See Also:

Since:

  • 0.5.0



45
46
47
# File 'lib/typhoeus/config.rb', line 45

def verbose
  @verbose
end