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



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

def cache
  @cache
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

#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